Death messages
Replace the vanilla death message ("Steve was slain by Zombie") with your own text for chosen deaths: the deathMessage action of a rule. Deaths without a rule that sets one keep the vanilla message.
Writing them
{
"rules": [
{ "match": "mekanism:acid", "then": { "deathMessage": "{player} dissolved in acid" } },
{ "match": "*@twilightforest:lich", "if": ["advancement:twilightforest:progress_lich"],
"then": { "deathMessage": "{player} was outsmarted by the Lich" },
"else": { "deathMessage": "{player} met something in the dark" } },
{ "match": "minecraft:lava @dim:minecraft:the_nether", "then": { "deathMessage": "&c{player} became part of the Nether" } }
]
}- The first rule from the top that sets
deathMessagefor this death wins (priority); with conditions, met and not met can have different messages. - Values are one-line templates: every template variable,
{var|fallback},&colors andlang:keys. lang:keys: on Forge / NeoForge each modded client translates the key (its language and resource packs). On Fabric 1.19.4+ the server sends the key as a translation, so every client with the key (a resource pack, a mod) sees its own text, also without What Hit Me?; clients without the key get the English text the server knows, or the key itself when the server does not know it either. Older Fabric versions send the server's English text. In translations use%1$s(player),%2$s(attacker) and%3$s(damage name) like vanilla death messages:{variables}are filled only where What Hit Me? renders the text itself.
Useful variables: {player}, {name}, {attacker_name}, {weapon}, {damage_name}, {dimension}, {death_message} (the vanilla text).
"mob:minecraft:zombie @item:*sword*": "{player} was cut down by {attacker_name} wielding {weapon|a blade}"Support matrix

| Server | Players with the mod | Players without the mod | Death screen | Server log |
|---|---|---|---|---|
| Fabric (every version) | Custom message | Custom message | Custom message | Custom message |
| Forge / NeoForge (every version) | Custom message (the client replaces the vanilla chat line) | Vanilla message | Custom message (Forge 1.7.10: the death screen shows no message) | [What Hit Me?] Death message: ... line |
Why the difference? Fabric lets the mod change the message where the game builds it, so everyone gets it. Forge and NeoForge have no event for that, so the server sends the custom text to modded clients, which replace the matching chat line and the death screen text. Players without the mod keep the vanilla message.
Forge / NeoForge servers
If it matters that nobody sees the vanilla message (for example because a rule hides the killer), turn on requireClientMod. Otherwise the server logs a warning on start and on /whm reload.
The death recap (/whm last, the panel) quotes the message the player actually saw.
Hidden death messages
When a rule hides death_message and no rule sets a deathMessage, a neutral built-in message is used:
| Killer | Message |
|---|---|
| An entity | {player} was killed by {name} — {name} is the rule's name, e.g. ??? |
| No entity | {player} died |
These are translated for players with the mod (10 languages). On Fabric they are sent as translations with an English fallback on 1.19.4+, and in English on older Fabric versions. Players without the mod see English.
A deathMessage set by a rule always wins over the built-in hidden message.
Testing
/whm test mekanism:acid
/whm test minecraft:generic twilightforest:lich --as Steve/whm test and the preview of the pack editor show the death message that would be used and the rule it comes from.
