Skip to content

Template editor ​

An in-game screen to write templates with a live preview. It works on every supported version and loader and needs the mod on the client.

Template editor

Typing a summary template: the preview updates on every keystroke, variables are inserted by clicking

Opening it ​

  • /whm template
  • The Templates... button in the settings screen (also from the Forge / NeoForge mods list and Mod Menu)

Step by step ​

  1. Pick an output with the tabs at the top: Hover, Line, Summary, Alert, Copy. In single player with cheats there is also Death msgs.
  2. Edit the lines. Each template line is a single-line text field.
    • + Line adds a line; ↑ / ↓ move a line; ✕ deletes it.
    • Usual text editing works: cursor, selection, Ctrl+A / C / V / X, Home / End, Backspace / Delete.
  3. Insert variables from the list on the right. Click a variable to insert it at the cursor. Hover it (or select it) to see a one-line description at the bottom. Variables are grouped: Damage, Damage type, Attacker, Context, Other, and Script (variables registered by scripts on the server, with their description).
  4. Watch the preview below the lines. It is drawn by the same code as the real output: a tooltip for Hover, a panel line for Line, chat lines for Summary and Alert, a plain text box for Copy. It updates on every keystroke.
  5. Switch the preview data with Sample death / Latest death: your latest real death, or a built-in sample death.
  6. Save.

Unknown variables are shown in red in the text field, so typos are easy to spot.

Buttons ​

ButtonWhat it doesAvailable
SaveSaves to your personal templates (whathitme-client-templates.json)When the output is not locked
Save to packWrites config/whathitme/pack/templates/<output>.jsonSingle player with cheats
ResetRemoves your personal template of this outputWhen the output is not locked
Sample death / Latest deathSwitches the preview dataAlways
CloseLeaves the editorAlways

Opened from the Templates tab of the pack editor (Edit...), it edits the pack default of that output; the buttons are Done (saves the pack default), Sample death / Latest death and Cancel.

The line under the text fields tells you where the shown template comes from: Your personal template, Modpack template, or Built-in output (editing starts from an example).

Locked outputs ​

If the pack locks an output, the editor shows the pack's template read-only with the note Locked by the modpack (read-only). Save and Reset are disabled.

A locked output in the template editor

The screenshot also shows the syntax: fallbacks ({mob_name|unknown}, {attacker_owner|nobody}), decimals ({damage:2}) and the mob_ alias ({mob_name}).

Long lines and switched-off variables ​

Every line is a wrapping field that grows with its text, so long lines stay readable; Up / Down move inside a wrapped line first, then to the next line. Variables the pack switched off are grey in the variable list, and a line that uses one shows "Switched off by the modpack (renders empty)".

Rules in the preview ​

When the latest death was changed by a rule, the preview says so, for example progression rule: enforce, attacker, .... Rules are edited in the pack editor; check them with its preview or /whm test --as / --assume.

Workflow for pack makers

Build the templates in a single player test world with cheats, use Save to pack, then copy config/whathitme/pack/templates/ into your pack.

Made by junjun1z. The mods are MIT licensed.