Skip to content

Pack folder ​

config/whathitme/pack/ holds your pack definitions as JSON files: rules, templates and settings & locks. Edit the files by hand or in game with the pack editor; both write the same files.

Created on first start ​

If the folder is missing, the mod creates it with one _example.json per topic. Every entry in them is commented out, so nothing happens until you edit them.

config/whathitme/pack/
  rules/_example.json       rules: names, tips, death messages, triggers, ignore, hide
  settings/_example.json    settings, locks, disabledVariables, unlock conditions
  templates/_example.json   templates
  custom/_example.json      notes: any file may contain any key

How files are read ​

  1. Every .json file below pack/ is collected, in any subfolder (at most 8 levels deep).
  2. Files are sorted by their top-level "order" number (lower first, default 0), then by path (lower case, alphabetical). "enabled": false skips a file without deleting it.
  3. Their rules form one list in that order: rules of earlier files come first and win (priority). Templates and settings of later files replace those of earlier files with the same key; lock lists and disabledVariables add up.
  4. A file that cannot be parsed is skipped; /whm reload names it and the server log shows the reason. The other files still load.
  5. Save the files as UTF-8 (with or without BOM). A file in another encoding is read with the system encoding and a warning in the log.

The folder names are only for your own order. Any file may contain any of the keys. Organize by topic (pack/nether.json), by type (pack/rules/...) or by mod (pack/twilightforest.json), whatever you like.

Control the order

Set "order" (the pack editor's arrow buttons write it), or prefix the names: pack/10-bosses.json, pack/20-survival.json.

JSON format ​

Comments and trailing commas are allowed:

json
{
  // line comment
  /* block comment */
  "rules": [
    { "match": "minecraft:lava", "then": { "hint": "Carry a water bucket." } },   // trailing comma is fine
  ],
}

All keys ​

KeyTypePage
ruleslist of rule objectsRules
templatesobject: output -> list of linesTemplates
settingsobject: setting key -> value / { "value", "locked" } / unlock conditionsSettings & locks
locksobject: commands, personal, templates -> listsSettings & locks
disabledVariableslist of template variable namesSettings & locks
ordernumber (default 0)Load order of the file, lower first
enabledboolean (default true)false = the file is not loaded
memostringNote about the file, shown in the pack editor (rules have their own memo)

A complete file:

json
{
  "order": 10,
  "memo": "Bosses of Ember Frontier",
  "rules": [
    { "match": "*@minecraft:wither_skeleton", "if": ["advancement:minecraft:nether/find_fortress"],
      "then": { "name": "&8Ashen Sentinel", "hint": "Its blade inflicts Wither. Carry a bucket of milk." },
      "else": { "name": "???", "hide": ["attacker", "mod", "weapon", "tip"] } }
  ],
  "templates": { "copy": ["**Death recap** ({time})", "{timeline}"] },
  "settings": { "showTimestamp": { "value": false, "locked": true } },
  "locks": { "templates": ["copy"] },
  "disabledVariables": ["attacker_distance"]
}

Warnings ​

/whm reload, the server log and the pack editor report problems instead of failing silently:

ProblemWhat happens
Unknown key, for example "tip", "than", "command"Ignored, with "did you mean hint / then / commands?"
Section of the wrong type ("rules": 5, "settings": [])Section skipped; a single rule object instead of a list is read as one rule
Rule without matchRule skipped (it would match every damage; use "*" for that)
else on a rule without conditionsKept, but never used
Invalid setting value (wrong type, out of range, unknown key)Value ignored
Conditions on a layout / tracking settingConditions ignored
"order" that is not a numberRead as 0
Unknown template variable, switched-off variable in useWarning (the variable renders empty)
Unknown condition prefix, missing quest mod, condition not supported on this versionCondition counts as not met

Files in the 1.3 format ​

What Hit Me? 2.0 reads only the format on this page. The keys of the 1.3 format (renameMap, hintMap, deathMessages, deathTriggers, defaultIgnoredDamageIds, lockedFeatures, and rules with name / hint / hide / commands at the top level) are not read. When a pack file still has them:

  • the server log warns on start and on /whm reload (file and keys), and /whm reload lists them,
  • operators get a chat notice a few seconds after joining,
  • the pack editor shows a red banner on every tab with the files and keys, and two buttons:
    • Convert to the 2.0 format rewrites the files as rules, templates and settings (comments in those files are lost),
    • Delete 1.3 entries removes the old keys; files that had nothing else are deleted. "This cannot be undone."

Both buttons show the files and keys first and keep a copy of every touched file in config/whathitme/.backup/legacy-<time>/. The result names the backup folder.

The 1.3 banner of the pack editor with its two buttons

The confirmation before deleting the 1.3 entries

Applying changes ​

  • Run /whm reload (op). It reports files read and files with errors (with the file names), plus the warnings above. An open pack editor shows the new files at once.
  • On a dedicated server the server reloads and sends the result to every modded client at once.
  • Opening a world in single player (or starting a server) reads the pack folder and whathitme-common.cfg again, so edits made while the game was running apply to the next world without /whm reload.
  • The pack editor saves and reloads by itself.

Client-only installs

When the server does not have the mod, each client uses its own pack folder: names, tips and ignore from rules work, conditions count as not met, nothing is hidden, and triggers never run.

/whm reload: files read, files with errors and warnings

Made by junjun1z. The mods are MIT licensed.