LogicUsing Events
Player Death
Triggers actions when a player dies within a region.
This event triggers when a player dies. The event's location is the location of the player's death.
Action Values
Player: The player who died.Entity: The player who died (can also be targeted as a generic entity).Killer: The entity (player or mob) that dealt the final blow. This value may not always be present (e.g., death by falling).
Event Configuration
- Cancel Event: If
true, the player will not die. This is extremely useful for creating custom death mechanics, such as a "downed" state or simply negating death in certain areas.
Use Cases
- Creating a team deathmatch game where a team's score increases on a kill.
- Removing a "life" from a player's
Livesproperty when they die. - Announcing a player's death in chat.
Example: Announce Death and Subtract a Life
- Create Property: A
Player Numberproperty namedLives, with a default value of3. - Region: Select your main gameplay region.
- Event: Add a
Player Deathevent. - Actions:
Change Property: Target thePlayer, select theLivesproperty, and use the Subtract operator with a value of1.Send Message: To Everyone, with the message:&e%p_player_name_player% &chas died! They have &e%p_Lives_player% &clives remaining.