Skip to content

on_self_despawn

fun <reified K : Entity> on_self_despawn(behaviour: (self: K) -> Unit)
(self: K) -> Unit

Works with: Entity

Example
node<Npc>()
on_self_despawn { npc ->
Logger.info("the skeleton in shard ${npc.shardId} left the world")
}