Function of World
world.on_entity_death
Tells after a mob died; it is gone, so its id and name is all there is. Mob kinds only.
world.on_entity_death(fn: (id: number, name: string) -> ()) → Connection
Parameters
fn(id: number, name: string) -> ()Returns
ConnectionUsed in
- At 0 health it dies as a mob: it falls over, leaves its `drops`, and is gone a second later. `on_remove` gets `"killed"`, and `world.on_entity_death` fires.Custom entitiesworld.on_entity_death(function(id, name) end) -> connection -- a mob died; it is gone, so id and name is all there isGame events`world.on_entity_spawn` fires for mob kinds only. `world.on_entity_death`Game events