LogicUsing Events
Entity Death
Trigger actions when a non-player entity dies within a region.
This event fires when any non-player entity (mob, armor stand, etc.) dies within the region.
Action Values
Entity: The entity that died.Killer: The entity that dealt the killing blow. This can be a Player or another mob. This value can be null if the death was from natural causes (e.g., falling).
Event Configuration
- Entity Type: Filter the event to only trigger for a specific type of entity (e.g., only
ZOMBIE). - Cancel Event: If
true, the entity will not die and will be left with a small amount of health. - Execution Mode: Control how often this event can be triggered.
Use Cases
- Creating custom loot drops for mobs.
- Spawning a new wave of enemies after a boss is defeated.
- Awarding points in a PvE game mode.
Example: Custom Zombie Loot Drop
- Region: Your main gameplay area.
- Event:
Entity Death. - Configuration: Set Entity Type to
ZOMBIE. - Actions:
Random Action:- Function 1 (Weight 1):
Spawn Itemaction that spawns aDIAMONDat theEntity's location. - Function 2 (Weight 9):
Spawn Itemaction that spawns aROTTEN_FLESH.
- Function 1 (Weight 1):