constructor(entity: EntityHandle)
View sourceCreates a deferred entity-removal command.
The constructor stores the handle only. It does not look up or remove the
entity until DespawnCommand#execute runs.
Class
ExtendsCommand
Builds a deferred request to remove one entity from a world.
The command stores the target handle without looking it up or changing the
world. DespawnCommand#execute delegates to
World#despawn, which removes the target entity and all of its
components. A stale handle has no effect. When hierarchy hooks are
installed, removing an entity with a Children component also
recursively removes its descendants.
const command = new DespawnCommand(entity)
command.execute(world)constructor(entity: EntityHandle)Creates a deferred entity-removal command.
The constructor stores the handle only. It does not look up or remove the
entity until DespawnCommand#execute runs.
execute(world: World): voidApplies the queued removal to a world.
Delegates to World#despawn with this command’s
DespawnCommand#entity payload. A stale handle is ignored by the
world.