Skip to content
Konjure / spatial intelligence

despawn

← Builtin reference

Schedules an entity for removal when the current initializer, callback, or action completes.

Signature

func despawn(entity: Entity) -> Unit

The entity must exist. Removal is deferred until the enclosing initializer, callback, or action completes so checked work sees a consistent world.

Parameters

entity: Entity
An existing entity identity.

Returns

Unit

Unit; removal is deferred to preserve transactional execution.

Examples

Schedule removal

The current value remains printable while removal is pending.

Tick 0 · 0.00 s⌘ / Ctrl + EnterThis device
main.kj
Loading the language runtime…
Output 0
No output.
Expected output
entity(1)

Rust definition

Rust interpreter builtin dispatch; Type is func(Entity) -> Unit.

See also