Skip to content

Match keys ​

Every place that picks damage - the match of a rule and the keys of players' own names, tips and hidden damage - uses the same match key syntax.

The simplest key: a damage id ​

json
"minecraft:lava": "..."
"mob:minecraft:zombie": "..."

See Damage ids for how ids are built.

Composite keys ​

Add conditions to narrow the match. Write them in any order, separated by spaces or &:

ConditionMatchesExample
<damage id>The damage idminecraft:arrow, mob:minecraft:zombie
@<entity id> or @mob:<entity id>The attacker's entity id (@entity: works too)@minecraft:skeleton
@item:<item id>The item in the attacker's main hand@item:minecraft:iron_sword
@dim:<dimension id>The dimension where it happened@dim:minecraft:the_nether

All conditions must match.

json
{
  "rules": [
    { "match": "mob:minecraft:zombie @item:minecraft:iron_sword", "then": { "name": "Armed Zombie" } },
    { "match": "minecraft:arrow @minecraft:skeleton", "then": { "name": "Skeleton Sniper" } },
    { "match": "minecraft:lava @dim:minecraft:the_nether", "then": { "name": "Nether Lava" } }
  ]
}

Writing conditions without a space ​

A condition starting with @ can follow another one directly:

*@twilightforest:lich                         any damage from the Lich
minecraft:arrow@twilightforest:skeleton_druid that mob's arrows

Dimensions ​

@dim:the_nether (without namespace) also matches minecraft:the_nether.

Wildcards ​

Every condition may use * (any text) and ? (one character). Matching is case-insensitive. Wildcards lists every form, the key builder buttons, recipes and pitfalls.

KeyMatches
*@twilightforest:lich or @twilightforest:lichEvery hit by the Lich, whatever damage id its attacks use
@twilightforest:*Any attacker from Twilight Forest
mob:lycanitesmobs:*Melee attacks of every Lycanites Mobs creature
*acid*Every damage id containing "acid" (useful for ids a mod builds at run time)
minecraft:arrow @twilightforest:skeleton_druidOnly that mob's arrows
*Everything (put it last: a catch-all)

Large packs

Wildcards keep long lists short. Instead of one key per attack of a boss or per damage id of a mod, write *@twilightforest:lich (every hit by the Lich), @twilightforest:* (every Twilight Forest attacker) or *acid* (every damage id containing "acid"). See Large packs.

Which key wins? ​

There is no "most specific key wins" (see Wildcards: order and priority). Rules are checked from the top, and for each field the first rule that matches and sets it wins. Put special keys above general ones:

OrderKeyResult for the Lich's bolt
1twilightforest:lich_bolt @twilightforest:lichits tip wins
2@twilightforest:lichused for the Lich's other attacks
3*used when nothing above sets a tip

Players' own entries (personal mode) pick the most specific of their own keys (more conditions, then fewer wildcards); their own ignore list hides a hit when any of the player's keys matches.

Finding the right ids ​

NeedUse
Damage id of a hitHover text ID: ... or [Copy ID]
Entity ids, damage ids of a mod/whm search @modid
Browse everythingThe pickers of the pack editor: damage ids, mobs, items, dimensions with filters
Test a key/whm test <damage_id> [entity] [item] [dim]

Made by junjun1z. The mods are MIT licensed.