Guide 1 Docs 2 Reference 3
6

EntityAmendSpec type

Functions 6

entityAmendSpec.on_spawn((e: EntityHandle) -> ()) → ?

Called when a new entity of this kind spawns; told, never waited on.

entityAmendSpec.on_load((e: EntityHandle) -> ()) → ?

Called for an entity that already existed: a saved chunk loaded it, or a reload rebound it.

entityAmendSpec.on_steer((e: EntityHandle, base: () -> ()) -> ()) → ?

Wrapped behavior runs first unless options.replace = true.

entityAmendSpec.on_tick((e: EntityHandle, base: () -> ()) -> ()) → ?

Wrapped behavior runs first unless options.replace = true.

entityAmendSpec.on_damage((e: EntityHandle, amount: number) -> ("take" | "ignore")?) → ?

Asked when it takes damage; return "ignore" to cancel it. Silence or a missed deadline is "take".

entityAmendSpec.on_remove((e: EntityHandle, why: string?) -> ()) → ?

Called when it leaves the world; why is "removed", "settled", "killed" or "unloaded". Not called when the pack goes away.