Skip to content

LifetimeSystemOptions

Defined in: src/modules/lifetime/lifetime.ts:25

Options for makeLifetimeSystem: system name, runAfter, and an optional onExpire handler.

TCtx extends LifetimeTickCtx

optional name?: string

Defined in: src/modules/lifetime/lifetime.ts:26


optional onExpire?: (ctx, id) => void

Defined in: src/modules/lifetime/lifetime.ts:35

Called when an entity expires. When provided, the callback owns cleanup — the engine does not auto-destroy. If the callback does not call ctx.world.queueDestroy(id) (or otherwise remove the lifetime component), the entity will re-expire on the next tick. Exceptions thrown by the callback halt the remaining expiry loop.

TCtx

EntityId

void


optional runAfter?: string[]

Defined in: src/modules/lifetime/lifetime.ts:27