🔍Match Item Format
MatchItemFormat is the shared configuration format used whenever EnchantedMobs needs to test an ItemStack.
Common locations include match-item sections in player-power.yml, equipment matching inside MatchEntityFormat, and abilities that filter an item before acting on it.
match-item:
material:
- diamond_sword
has-enchants:
- sharpnessThe example matches a diamond sword that has Sharpness.
Evaluation rules
A MatchItemFormat section does not use a type field. Each recognized key enables one rule.
match-item:
material:
- diamond_sword
has-name: true
contains-name:
- LegendaryRules on the same level use AND:
the item must be a diamond sword;
the item must have a custom display name;
that name must contain
Legendary.
Within most list-based rules, entries use OR. For example, material: [diamond_sword, netherite_sword] accepts either material.
Empty and invalid inputs
A missing MatchItemFormat section matches everything.
A missing item does not match.
An item without
ItemMetadoes not match.An unrecognized key is ignored by the matcher.
none: trueforces the section to fail.
Logical composition
Use any when one of several alternatives may match:
Each numbered group uses AND internally; the numbered groups use OR.
Use not to reject items that match any nested rule:
See Logical and NBT Rules for both supported any layouts and the exact not behavior.
Optional rule availability
contains-nbt, nbt-string, nbt-byte, nbt-int, nbt-double
NBTAPI must be loaded when EnchantedMobs starts.
rarity
Minecraft/Paper 1.20.5 or newer.
External IDs in items
The corresponding supported item plugin must be installed.
Unavailable optional rules are not registered. Their configuration keys are therefore ignored rather than treated as a failed match.
Rule index
material
material-tag
rarity
has-name
contains-name
has-lore
contains-lore
has-enchants
has-stored-enchants
contains-enchants
contains-enchants-amount
enchantable
item-format
contains-nbt
nbt-string
nbt-byte
nbt-int
nbt-double
Complete example
The item must be a sword with a name, must match either the Sharpness group or the external-ID group, and must not contain Disabled in its lore.
Related references
MatchEntityFormat: entity matching and nested equipment matching.
ItemFormat™: the serialized structure used by the
item-formatrule.Abilities: abilities such as
disarmthat may use item matching.
Last updated