Skip to content

Settings & locks ​

The modpack decides the defaults of every setting, which settings players may change, which commands and personal features they may use, and which template variables exist. All of it lives in the pack folder ("settings", "locks", "disabledVariables" in any pack file) and is edited in one screen: the Settings tab of the pack editor.

The Settings tab: one row per setting with its value, "if" for unlock conditions and the lock

Values and locks ​

Every key of whathitme-common.cfg and whathitme-client.cfg (see Configuration files) can get a pack value and a lock:

json
{
  "settings": {
    "historySize": { "value": 100 },
    "showTimestamp": { "value": false, "locked": true },
    "showInternalDamageId": { "locked": true },
    "scale": 0.7
  }
}
EntryEffect
"value" onlyThe default for players. It applies while the player has not chosen a value (in game, or by editing their file).
"value" + "locked": trueForced. Players cannot change it; the settings screen shows it grey with "locked by the modpack", /whm config refuses it.
"locked": true without valueForced to the built-in default.
"key": 100Short for { "value": 100 }.
  • An invalid value (wrong type, out of range, unknown choice) is ignored with a warning.
  • On a server with the mod the server's pack decides for every modded client (the client file follows it while connected). In single player and in client-only mode the local pack folder decides.
  • A locked display switch is forced in both files: locked on means shown even when the player turned it off.
  • When two files set the same key, the later file wins.

In the Settings tab each row has the value control (checkbox, number field confirmed with Enter, or choice button), ↺ to remove the pack value, if for unlock conditions and the lock checkbox. Rows without a pack value are grey. Changes are saved at once; Undo reverts the last change. A setting is written into the last loaded file that has it, otherwise into settings/pack-settings.json.

Groups ​

GroupRows
DisplayDisplay switches (panel, chat summary, alerts, mitigation details, attacker, tips, buttons ...)
TrackingFilters (thresholds) and recording (historySize, mergeWindowSeconds, summarySeconds, recapSeconds, maxSnapshots, requireClientMod)
LayoutDeath screen panel (anchorPoint, offsets, scale, opacity, lines)
TemplatesLocks of the five template outputs, and the list of template variables with on / off
CommandsWho may use each command: everyone, operators or nobody
PersonalLocks of personal names, tips, ignore list and templates

Locking offsetX or offsetY fixes the panel where you put it: players cannot drag it, and nothing is saved in their file. Locking minimized removes the [-] / [+] button. Leave them unlocked to give players a default position they can still move.

The group header shows "n / m locked" and has a checkbox that locks (or, when all are locked, unlocks) the whole group; the Commands header shows "n / m changed" instead. The search field filters rows across groups.

Commands ​

json
{ "settings": { "command.stats": "op", "command.snapshot": "none", "command.test": "none" } }

Each command row has a choice instead of a lock box:

ValueWho may use itIn help and completion
all (everyone)every playershown to everyone
op (operators)operators (permission level 2, single player with cheats)shown to operators only
none (nobody)nobody, operators includedhidden from everyone
CommandsDefaultChoices
history, last, snapshot, effects, stats, search, togglechat, template, configallall, op, none
inspect, testopop, none
pack, reloadopalways op (shown as "Operators (fixed)")
  • /whm pack and /whm reload can never be turned off: if nobody could use them, nobody could fix the pack in game. A pack file that tries ("command.pack": "none") gets a warning and is ignored.
  • config set to op or none also closes the settings screen and personal mode for players.
  • "locks": { "commands": ["stats"] } still works and means "command.stats": "none".
  • Wrong values ("command.stats": "maybe", "command.test": "all") are reported by /whm reload; all on inspect / test becomes op.

Commands group: who may use each command

Personal features ​

json
{ "locks": { "personal": ["renames", "hints", "ignore", "templates"] } }
LockPlayers cannot use
renamestheir own names (personal mode)
hintstheir own tips (personal mode)
ignoretheir own hidden damage (personal mode, [Mute])
templatespersonal templates (every output)

Locked personal entries are ignored, the [Mute] button is refused, and the fields in personal mode are read-only.

Templates and variables ​

json
{
  "locks": { "templates": ["summary", "copy"] },
  "disabledVariables": ["attacker_distance", "attacker_owner"]
}
  • A locked output (hover, line, summary, alert, copy) always uses the pack template (or the built-in look); players see it read-only in /whm templates. The Templates tab has the same lock per output.
  • A switched-off variable renders empty everywhere: in personal and pack templates, in rule names, tips, death messages and trigger commands. A line whose placeholders are all empty is dropped; {var|fallback} shows the fallback. Editors show it grey with "Switched off by the modpack", and /whm reload warns when a pack template or rule still uses it.

Templates group: output locks and the variable list

Unlock conditions ​

Display switches and command locks can depend on the player's progress, with the same conditions as rules (advancements, tags, scores, Game Stages, FTB Quests, Better Questing, Heracles, script:):

json
{
  "settings": {
    "showMitigationDetails": {
      "if": ["advancement:minecraft:story/obtain_armor"],
      "value": true,
      "else": { "value": false, "locked": true },
      "message": "&aArmor details unlocked: hover a hit to see what your armor blocked."
    },
    "command.stats": {
      "if": ["ftbquests:1A2B3C4D5E6F7081"],
      "value": "all",
      "else": { "value": "none" },
      "message": "&a/whm stats unlocked"
    }
  }
}
FieldMeaning
if / any / unlessThe conditions (all of / at least one of / none of)
value, lockedValue and lock when the conditions are met (command rows: value is all, op or none)
else{ "value": ..., "locked": ... } when they are not met
messageOptional chat line (& colors, lang: keys) when the conditions become met
  • Only display switches and command.<name> rows take conditions. Layout, tracking and filter settings stay the same for everyone (conditions on them are ignored with a warning). "command.stats": "none" is a plain setting without conditions.
  • The server checks every online player every few seconds and sends each player the values and locks that apply to them. Players without the mod get the server-made output (chat, alerts) with their own values too.
  • The unlock message is sent when a row goes from not met to met, not on login or reload.
  • In the player's settings screen these rows are read-only and show "unlocks with progress" or "unlocked by progress".
  • Without a player (server-wide decisions, client-only mode) the not met branch applies.

In the Settings tab, press if on a row (it shows if n when it has n conditions) to open the dialog: conditions (+ Condition... opens the condition picker, + Type one adds an empty line), the value and lock (for commands: who may use it) when met and when not met, the unlock message, and Remove conditions (keeps the met value as a plain entry). Rows with conditions show "by condition" and their lock checkbox is decided by the dialog.

The unlock conditions dialog of showMitigationDetails

Setting a value and a lock, then adding an unlock condition

From scripts ​

Scripts can do all of this at run time: setSetting(key, value, locked), setSettingRule(key, json), addLock(group, name) and disableVariable(name). See Script integration. Locks added by scripts are shown in the Settings tab but cannot be removed there.

Permissions ​

What Hit Me? has no permission nodes. It uses the vanilla operator level:

WhoCan
Everyonethe commands set to all (by default every player command), personal /whm config and personal mode, view world /whm config, /whm template
Op (permission level 2, or single player with cheats)also the commands set to op (by default inspect, test), reload, /whm pack, change world /whm config
The server consoleEverything server-side; rule triggers run with console permission

Locks beat op

A locked setting or a command set to nobody cannot be used or changed by anyone in game, operators included. Operators change the lock or the choice itself in the pack editor's Settings tab, or edit the pack file and run /whm reload.

Made by junjun1z. The mods are MIT licensed.