entity:destroyed
Shared
Fired when any entity instance is removed from the engine registry
Signal
"entity:destroyed"Arguments
| Type | Name | Description |
|---|---|---|
userdata | entity | The entity instance being destroyed |
The entity reference is still valid during the handler.
- Use it for last-moment cleanup before the entity is gone.
- After the handler returns the entity is removed from the registry and marked as destroyed.
Example
util.event.on("entity:destroyed", function(entity)
core.engine.print("info", "Entity destroyed:", entity:get_type())
end)