Skip to content

Wildcards ​

A wildcard lets one match key cover many damage ids, mobs, items or dimensions. They work everywhere a match key is used: the match of rules, and players' own names, tips and hidden damage (personal mode, ignoredDamageIds, renameMap, hintMap).

The two wildcard characters ​

CharacterMatchesExample
*Any text, also noneminecraft:*, *acid*, *
?Exactly one charactermob:minecraft:z?mbie
  • Matching is case-insensitive: MINECRAFT:FALL, minecraft:outofworld and *OutOf* all match minecraft:outOfWorld.
  • Every other character is plain text: . is a dot, there are no regular expressions or [a-z] ranges.
  • A part must match the whole value: minecraft:arrow does not match minecraft:arrow_tipped, minecraft:arrow* does.

Where you can put a wildcard ​

Each part of a key can have its own wildcards. All parts must match.

PartFormWhat it matches
Damage id*, modid:*, mob:*, mob:modid:*, *text*The damage id
Attacker@*, @modid:*, *@modid:*The entity id of the attacker (for projectiles: the shooter)
Item@item:*, @item:modid:*, @item:*_swordThe item in the attacker's main hand
Dimension@dim:*, @dim:modid:*, @dim:the_*The dimension where it happened

Every form and what it matches ​

KeyMatchesDoes not match
*Every damage (the catch-all)-
minecraft:*Every damage id of vanilla: fall, lava, arrows, explosions ...Melee hits (mob:minecraft:zombie starts with mob:)
twilightforest:*The damage ids a mod registered itself (twilightforest:lich_bolt)Its mobs' melee, its mobs' vanilla arrows (minecraft:arrow)
mob:*Every melee hit by any entity, also players (mob:minecraft:player)Arrows, explosions, magic of mobs
mob:minecraft:*Melee by vanilla mobsMelee by modded mobs
mob:alexsmobs:*Melee by the mobs of one mod-
@twilightforest:* or *@twilightforest:*Every hit whose attacker comes from that mod: melee, arrows, spells, explosionsDamage without an attacker (fall, lava)
@*Every hit that has an attackerFall, lava, drowning, the void ...
@item:*Hits by an attacker that holds somethingUnarmed mobs, damage without an attacker
@item:*_swordAttackers holding any sword (iron_sword, diamond_sword, modded swords)Bows, axes
@dim:*Every hit with a known dimension-
@dim:the_*minecraft:the_nether, minecraft:the_end (the namespace may be left out)minecraft:overworld
*acid*Every damage id containing "acid", for ids a mod builds at run time-
*:fallfall of any mod-
unknown:*Modded damage whose mod could not be found (before 1.19.4)-

@ alone means "the attacker"

@twilightforest:* and *@twilightforest:* are the same key: a key without a damage id matches any damage id. The *@ form is what the key builder writes.

Combined keys with several wildcards ​

Separate the parts with spaces or &, or write an @ part directly after the previous one. Each part may use its own wildcards:

json
{ "match": "mob:*:z* @minecraft:* @item:*_sword @dim:*overworld", "then": { "name": "Armed undead" } }

This matches melee by a vanilla mob whose id starts with z (zombie, zombie villager, zoglin ...), holding a sword, in the Overworld.

What does not exist ​

WrittenWhat happensWrite instead
mod:twilightforest or mod:*Matches nothing: there is no mod: condition. /whm reload and the editor warn.twilightforest:* (its damage ids), mob:twilightforest:* (its melee), @twilightforest:* (any hit by its mobs)
minecraft:fall minecraft:lavaMatches nothing: every part of a key must match, and a hit has one damage id. Warned.Two rules, one per damage id (or minecraft:* if that is what you mean)
@item: or @ with nothing after itMatches nothing. Warned.@item:* for "holds anything"

Order and priority ​

Pack rules: list order, wildcards count for nothing ​

Rules are checked from the top, and for each field the first matching rule that sets it wins. A wildcard rule above an exact rule hides the exact rule for the fields both set:

json
"rules": [
  { "match": "mob:*",             "then": { "name": "Some mob" } },
  { "match": "mob:minecraft:pig", "then": { "name": "Pig", "hint": "Pigs do not attack." } }
]

The pig gets the name Some mob (rule 1 sets the name first) and the tip from rule 2 (rule 1 sets no tip). Put special keys above general ones and the catch-all * last:

json
"rules": [
  { "match": "minecraft:arrow @minecraft:skeleton", "then": { "name": "Skeleton Sniper" } },
  { "match": "*@minecraft:skel*",                   "then": { "name": "Skeleton", "hint": "Use a shield." } },
  { "match": "mob:*",                               "then": { "name": "{attacker_name}" } },
  { "match": "*",                                   "then": { "hint": "Check /whm for what hit you." } }
]

A skeleton's arrow: name from rule 1, tip from rule 2. The pack editor's arrows move rules; the preview shows which rule sets each field.

Players' own entries: the most specific key wins ​

Players' own names and tips (personal mode, renameMap, hintMap) have no list order. Of the player's keys that match, the one that wins:

  1. has the most narrowing parts: every part counts, except a damage id made only of *. @*, @item:* and @dim:* count, because they need an attacker, an item or a dimension;
  2. on a tie, has fewer parts with wildcards;
  3. on a tie, comes first.
Player's keysZombie with a swordFall
*wins
*@*
mob:minecraft:*
mob:minecraft:zombie @item:*wins (2 parts)

Without the last key, the zombie would get mob:minecraft:* (1 part, 1 wildcard) over *@* (1 part, 2 wildcards). The player's own ignore list hides a hit as soon as any key matches, so * there hides everything.

Where to click in the pack editor ​

Pick... next to the match key opens the match-key builder. The row of buttons under the list inserts wildcards:

The match-key builder: the zombie picked in the Mobs list, then the minecraft:* and mob:minecraft:* buttons

ButtonWritesInto
**The part of the list shown (Damage ids, Mobs, Items or Dimensions)
<mod>:* (minecraft:* in the picture)The mod of the picked row, or of the All mods filter when no row of that mod is picked. Grey mod:* until then.The part of the list shown
mob:* / mob:<mod>:*mob:*; in the Mobs list with a picked row or mod filter mob:<mod>:*Always the damage id field
ClearEmpties all four fields

Examples:

GoalClicksResult
Any hit by a Twilight Forest mobMobs, mod filter Twilight Forest (or click one of its mobs), twilightforest:**@twilightforest:*
Melee of vanilla mobsMobs, click a vanilla mob, mob:minecraft:*mob:minecraft:*@minecraft:zombie; empty the attacker field to keep only mob:minecraft:*
Every vanilla damage id in any dimensionDamage ids, mod filter Minecraft, minecraft:*, then Dimensions, *minecraft:* @dim:*
Every hit by an armed attackerItems, *@item:*

The fields under the buttons can also be typed into (wildcards allowed). OK puts the result into the rule.

The editor warns under the key field when a part matches nothing the server knows, and for the mistakes above. The preview of a wildcard key tests one real id that fits it (for mob:*@minecraft:skel*: mob:minecraft:skeleton by a skeleton).

Recipes ​

Rename every mob of a mod ​

json
{
  "rules": [
    { "match": "*@alexsmobs:*", "then": { "name": "{attacker_name} &7(Alex's Mobs)" } }
  ]
}

*@ covers melee, arrows and spells of those mobs. Use mob:alexsmobs:* for melee only.

Hide all damage from a mod until a quest is done ​

Two rules: the damage ids of the mod itself, and every hit by its mobs (which may use vanilla damage ids).

json
{
  "rules": [
    { "match": "mekanism:*",   "unless": ["ftbquests:1A2B3C4D5E6F7081"], "then": { "ignore": true } },
    { "match": "*@mekanism:*", "unless": ["ftbquests:1A2B3C4D5E6F7081"], "then": { "ignore": true } }
  ]
}

To keep the hits but hide what caused them, use "hide": ["damage_id", "attacker", "mod", "weapon", "death_message"] and a name like "&k???" instead of ignore (see Progress).

One tip for a whole mod, better ones for its boss ​

json
{
  "rules": [
    { "match": "twilightforest:lich_bolt @twilightforest:lich", "then": { "hint": "Reflect the bolts with a sword swing!" } },
    { "match": "@twilightforest:lich", "then": { "hint": "Break the shields first." } },
    { "match": "@twilightforest:*", "then": { "hint": "Twilight Forest mobs hit hard." } }
  ]
}

Ids a mod builds at run time ​

json
{ "match": "*radiation*", "then": { "name": "Radiation", "ignore": true } }

Careful: a damage id also contains mob ids (mob:somemod:radiation_zombie), so *radiation* matches that zombie's melee too. Use somemod:*radiation* to stay with damage ids.

Every armed mob, every PvP hit ​

json
{
  "rules": [
    { "match": "mob:minecraft:player", "then": { "hint": "Another player got you." } },
    { "match": "@item:*", "then": { "hint": "{attacker_name} had a weapon: {weapon}." } }
  ]
}

Tips per dimension ​

json
{
  "rules": [
    { "match": "* @dim:the_nether", "then": { "hint": "Bring fire resistance to the Nether." } },
    { "match": "* @dim:twilightforest:*", "then": { "hint": "The Twilight Forest has its own bosses." } }
  ]
}

Pitfalls ​

  • * at the top sets its fields for everything: no rule below can set them any more. Keep the catch-all last.
  • mob:* is melee only. Arrows of a skeleton are minecraft:arrow, explosions minecraft:explosion.player (minecraft:player_explosion from 1.19.4). Use *@<mod>:* or @* for "anything a mob did".
  • <mod>:* is only what the mod registered. Many modded mobs use vanilla damage ids; those start with minecraft:.
  • Wildcards in @, @item: and @dim: need a value. @* never matches fall damage, @item:* never matches an unarmed mob.
  • Every id has a namespace. A damage, attacker or item part without modid: and without wildcard (zombie, @zombie) never matches; write @minecraft:zombie or *zombie*. The editor says so while you type and refuses to save such a key.
  • Text inside an id: *slime* also matches mob:minecraft:slime; add the namespace when that matters.
  • Dimensions: the namespace may be left out, with or without wildcards (@dim:the_nether, @dim:the_*). On 1.12.2 and older, modded dimensions are dim:<name> (dim:twilight_forest), so @dim:twilight* and @dim:dim:* both work.
  • Damage ids differ between versions: minecraft:outOfWorld (before 1.19.4) vs minecraft:out_of_world. *out*of*world* matches both. Modded damage whose mod could not be found is unknown:<type> before 1.19.4.
  • Personal ignore is "any key": a personal * hides every hit for that player.

Checking a key ​

HowShows
Pack editor / personal mode / key builderWhile you type: why a key can never match (no namespace, empty part), then the warnings below
/whm reloadWarnings for keys that cannot match (mod:, empty parts, two damage ids, parts without namespace)
/whm test <damage_id> [entity] [item] [dim]Which rule sets each field for that hit, e.g. /whm test mob:somemod:beast or /whm test minecraft:arrow minecraft:skeleton
Pack editor previewThe same for the open rule, with one real id that fits its wildcards
/whm search @modidThe real ids of a mod, to see what modid:* and @modid:* will cover

Made by junjun1z. The mods are MIT licensed.