For the complete documentation index, see llms.txt. This page is also available as Markdown.

🔍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:
    - sharpness

The 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:
    - Legendary

Rules on the same level use AND:

  1. the item must be a diamond sword;

  2. the item must have a custom display name;

  3. 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 ItemMeta does not match.

  • An unrecognized key is ignored by the matcher.

  • none: true forces 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

Rules
Requirement

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

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.

  • MatchEntityFormat: entity matching and nested equipment matching.

  • ItemFormat™: the serialized structure used by the item-format rule.

  • Abilities: abilities such as disarm that may use item matching.

Last updated