Skip to content

Death Messages

okereke-dev edited this page Jul 4, 2026 · 2 revisions

Death Messages

RPGMood replaces vanilla death messages with narrative, context-aware ones, composed from independent building blocks so the same exact line rarely repeats. Every message is also saved to the killed player's adventure journal.


How a message is built

On PlayerDeathEvent, RPGMood detects:

  • Causeentity (killed by a mob), fire, fall, void, explosion, drowning, or the raw damage cause name as a fallback
  • Biome — the player's current biome
  • Killer — the entity type that killed the player, or none
  • Armed — whether the player is carrying a sword, axe, bow, trident, pickaxe, or shield
  • Location name — a flavor name for the current biome (see below)

Step 1 — pick a core line

All matching templates from causes.<cause>, biomes.<biome>, killers.<killer> (skipped if no killer), armed.<true|false>, and fallback are pooled together, and one is picked at random. If the same exact line was just used for that player, RPGMood re-rolls once to reduce back-to-back repeats.

{player}, {location}, {killer}, {biome}, and {armed} placeholders are filled in — {killer} is replaced with a random entry from killer_synonyms.<killer> (e.g. "zombie" → "shambling snack", "graveyard gremlin", ...) instead of the plain entity name, which is itself an independent roll on top of the core line.

Step 2 — maybe append a modifier

Independently, there's a 45% chance a closing flourish from modifiers gets appended after the core line (e.g. "The night keeps its own score."). This roll is completely independent of which core line was chosen, which is what turns the system from "pick 1 of N" into "pick 1 of N, then optionally combine with 1 of M" — multiplying the effective number of distinct outputs instead of just adding to a single pool.

Step 3 — resolve the location name

{location} isn't just the biome's plain name. RPGMood picks a base name from location_names.<biome>, then independently:

  • Picks a template from location_name_templates (e.g. "{base}", "the {descriptor} {base}")
  • Picks a descriptor from location_name_descriptors.<biome> (falls back to location_name_descriptors.default)

...and combines them, e.g. "the ash-choked Elden Meadows" instead of always just "Elden Meadows".


Example config snippet

death_messages:
  fallback:
    - "&7{player} met an untimely end."
  causes:
    entity:
      - "&6{player} was claimed by the wilderness near {location}."
  killers:
    zombie:
      - "&c{player} was overwhelmed by a very rude {killer}."
  killer_synonyms:
    zombie:
      - "zombie"
      - "shambling snack"
  modifiers:
    - "The night keeps its own score."
  location_name_templates:
    - "{base}"
    - "the {descriptor} {base}"
  location_name_descriptors:
    default:
      - "ash-choked"
  location_names:
    plains:
      - "Elden Meadows"

All of causes, biomes, killers, armed, fallback, modifiers, location_name_templates, location_name_descriptors, and location_names accept as many entries as you want — every entry you add multiplies the available variety. See Configuration for the full key reference.

Clone this wiki locally