Function of World
world.on_entity_spawn
Tells after a mob appeared, with its handle and name; a natural spawn fires it on every game version that has one, and a pack's own world.spawn("cow", pos) fires it too. Mob kinds only.
world.on_entity_spawn(fn: (entity: EntityHandle, name: string) -> ()) → Connection
Parameters
fn(entity: EntityHandle, name: string) -> ()Returns
Connection