Skip to content

Scanner & /whm test ​

Writing rules needs damage ids. These tools list them before anyone takes that damage, and let you check your work without dying.

Damage id scanner ​

MinecraftHow ids are found
1.7.10 - 1.19.3After a cache miss (first start, mod list changed, /whm reload) a background thread reads the class files of the mod jars (without loading classes) and collects the string ids passed to damage source constructors, including subclasses and setter calls right after the constructor. Nested jars are read one level deep.
1.19.4+Every key of the game's damage type registry is listed, with flags from its tags. No scan needed.

The results are stored under scan in config/whathitme/.cache/catalog_cache.json and show up in:

  • the damage id picker of the pack editor, with property filters (fire, magic, explosion, projectile, bypasses armor),
  • /whm search #scanned,
  • Tab completion of /whm test.

The pack editor also lists every registered mob (with boss / hostile / neutral / passive filters), every item of every mod (weapon / armor / tool / food / block) and every dimension the server has, including ones nobody visited yet.

Catalog cache ​

Damage types, mobs and effects are scanned once and saved with a SHA-256 of the sorted modid:version list. On the next start with the same mods, the list is loaded from the cache. A different mod list, or /whm reload, rescans.

/whm test ​

Op only. Builds a dummy killing blow and shows what players would see.

/whm test <damage_id> [entity_id] [item_id] [dim_id] [--as <player>] [--assume <condition>]...
ArgumentMeaning
damage_idThe damage id, for example minecraft:lava or mob:minecraft:zombie
entity_idThe attacker (- = none; for mob: ids the entity is taken from the id)
item_idThe attacker's main hand item (- = none)
dim_idThe dimension (default: yours)
--as <player>Evaluate rule conditions with that online player's progress
--assume <condition>Treat a condition as fulfilled (!cond = as not fulfilled). Repeatable.

It shows:

  1. which rule each field comes from, for example name from rule *@minecraft:wither_skeleton (rules/bosses.json #1); or Rule: none matches, or Rule: 2 rule(s) match, none sets anything here (conditions not met),
  2. the hidden fields, Enforced: ... when a branch hides something (personal names, tips and templates do not apply), Ignored by a rule,
  3. the resulting name and tip,
  4. the triggers that would run, with placeholders filled in and the rule they come from (they are not run),
  5. the death message that would be used,
  6. a preview of the respawn chat summary.

Examples:

/whm test minecraft:lava
/whm test mob:minecraft:zombie - minecraft:iron_sword
/whm test minecraft:arrow minecraft:skeleton
/whm test twilightforest:lich_bolt twilightforest:lich - twilightforest:twilight_forest
/whm test minecraft:generic --as Steve
/whm test minecraft:generic --as Steve --assume advancement:minecraft:story/mine_diamond --assume !tag:veteran

The pack editor runs the same test at the end of every rule ("For this hit it becomes:").

Test before you ship

After every change to your pack files: /whm reload, read the warnings, then /whm test the keys you changed. With conditions, test both "met" and "not met" with --assume.

/whm test for a wither skeleton --as Steve: the rule of each field and the chat preview

Made by junjun1z. The mods are MIT licensed.