Death Configuration
Configure what happens when a citizen is killed — item drops at the citizen's location, messages to the killer, and server commands triggered on death.
How to Access Death Config
Death configuration is found at Edit Citizen → Behaviors → Advanced Configuration → Death Config.
Takes Damage Required
For death to occur, the citizen must have Takes Damage enabled in the Behaviors screen. A citizen with Takes Damage disabled is invulnerable and the Death Config will never trigger.
Overview
The Death Config has three independent systems that can each be configured:
- Drop Items — Items spawned at the citizen's location when it dies.
- Death Messages — Chat messages sent to the player who killed the citizen.
- Death Commands — Commands run when the citizen dies.
Item Drops
Configure items that spawn at the citizen's location when it dies. Each entry has two fields:
| Field | Description |
|---|---|
itemId |
The item identifier to drop (must be a valid Hytale item ID) |
quantity |
How many of this item to drop |
Example: Loot Drops
Item 1: itemId = "gold_coin" quantity = 5
Item 2: itemId = "health_potion" quantity = 1
Death Messages
Death messages are sent to the player who killed the citizen. They support the same color tags and placeholders as regular citizen messages (see Color Formatting and Placeholders).
Message Fields
| Field | Description | Default |
|---|---|---|
message |
The message text. Supports {RED}, {#hex}, {PlayerName}, {CitizenName}. |
Required |
delaySeconds |
Seconds to wait before sending this message after the citizen dies | 0.0 |
Example: Death Messages
Message 1: "{RED}You have defeated {CitizenName}!" — Delay: 0.0s
Message 2: "{GOLD}+50 XP awarded to {PlayerName}." — Delay: 0.5s
Death Commands
Death commands run when the citizen dies. They use the same format as Command Actions — including runAsServer, delaySeconds, {PlayerName} / {CitizenName} placeholders, and the {SendMessage} prefix.
Example: Award XP on Kill
Command 1: give {PlayerName} diamond 1 — runAsServer: true — Delay: 0.0s
Command 2: xp add {PlayerName} 50 — runAsServer: true — Delay: 0.5s
Selection Modes
Both death messages and death commands have their own independent selection mode, controlling how entries are chosen when the citizen dies:
| Mode | Behavior |
|---|---|
| All | Every entry triggers (default). All messages are sent and all commands are run. |
| Random | One entry is picked at random. |
| Sequential | Entries cycle in order. Each kill advances the position by one. |
Respawn on Death
If you want the citizen to respawn after dying, enable Respawn on Death in the Behaviors screen and set a respawn delay. The Death Config fires before the citizen respawns.