メインコンテンツまでスキップ

on_corpse_spawn

Fires when a player dies and their corpse appears in the world.

Unlike a plain action, this goes through the engine's trigger pipeline, so the criteria and modifiers on the entries it triggers are evaluated normally.

Fields

FieldTypeDescription
triggersList<Ref<Triggerable>>Entries to trigger when the corpse spawns.

Context keys

KeyTypeDescription
OWNER_NAMEStringName of the dead player.
OWNER_UUIDStringUUID of the dead player.
EXPERIENCEIntExperience stored in the corpse.
ITEM_COUNTIntNumber of non-empty item stacks in the corpse.
CORPSE_POSITIONPositionWhere the corpse stands.

How could this be used?

Announce the death, start a "recover your things" quest, or record where the player fell.