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

Logical and NBT Rules

Every rule on this page is a key inside a MatchItemFormat section.

Logical rules


any

Purpose: Accepts an item when at least one nested alternative matches.

Context: Nested sections use the same MatchItemFormat rules.

Fields

Field
Default
Description

any

unset

A direct rule section or numbered groups.

Direct-rule layout

match-item:
  any:
    material:
      - diamond_sword
    contains-name:
      - Relic

When any does not contain a key named 1, every directly nested rule is tested independently. The example matches a diamond sword or an item whose name contains Relic.

Numbered-group layout

When any contains a key named 1, each child is treated as a complete MatchItemFormat group:

  • rules inside one numbered group use AND;

  • numbered groups use OR.

Behavior and limits

  • An empty any section returns true.

  • The numbered form is detected specifically by the presence of key 1; use consecutive numeric keys beginning with 1.

  • In the direct layout, keys are alternatives rather than an AND group.

  • Use the numbered layout whenever one alternative needs several rules.


not

Purpose: Rejects an item when any nested rule matches.

Context: Nested keys use the same MatchItemFormat rules.

Fields

Field
Default
Description

not

unset

Rules whose matches should be rejected.

Example

Behavior and limits

  • Nested rules are tested as separate rejection alternatives.

  • The example rejects the item if its name contains Broken or if it has no lore.

  • not does not invert the AND result of all nested keys as one group.

  • To reject a specific combination, place that combination in an any group outside the current matcher or restructure the surrounding configuration.

  • An empty not section matches because no nested rule rejects the item.

NBTAPI rules

The rules below are registered only when the plugin named NBTAPI is loaded during EnchantedMobs startup.

NBT paths use ;; between compound names, the final key, operators, and values. Entries in each list use OR.


contains-nbt

Purpose: Checks whether at least one NBT key exists.

Context: Requires NBTAPI.

Fields

Field
Default
Description

contains-nbt

unset

NBT key paths to test.

Example

Behavior and limits

  • A single segment checks a root key.

  • Multiple segments traverse compounds and use the final segment as the required key.

  • The value and NBT type are not checked.

  • One existing key is sufficient.

  • Missing compounds or keys do not match.


nbt-string

Purpose: Matches an NBT string value exactly.

Context: Requires NBTAPI and an NBT string tag at the selected path.

Fields

Field
Default
Description

nbt-string

unset

Entries in path;;key;;value form, or key;;value for a root key.

Example

Behavior and limits

  • Root syntax is key;;expected-value.

  • Nested syntax is compound[;;compound...];;key;;expected-value.

  • The tag must be NBT string type.

  • String comparison is exact and case-sensitive.

  • The delimiter cannot be escaped inside a compound, key, or expected value.


nbt-byte

Purpose: Compares an NBT byte value.

Context: Requires NBTAPI and an NBT byte tag.

Fields

Field
Default
Description

nbt-byte

unset

Entries in path;;key;;operator;;value form, or key;;operator;;value at root.

Example

Behavior and limits

  • Supported operators are >=, >, <=, <, and ==.

  • The expected value must fit Java's byte range.

  • Invalid operators or numbers do not match; malformed numeric values may also produce a configuration-time/runtime parsing error when evaluated.

  • Comparison uses the actual NBT byte value, not a boolean conversion.


nbt-int

Purpose: Compares an NBT integer value.

Context: Requires NBTAPI and an NBT integer tag.

Fields

Field
Default
Description

nbt-int

unset

Entries in path;;key;;operator;;value form, or key;;operator;;value at root.

Example

Behavior and limits

  • Supported operators are >=, >, <=, <, and ==.

  • The tag must be NBT integer type; byte, long, and double tags do not match.

  • Nested compounds may be chained with additional ;; segments.

  • Entries use OR.


nbt-double

Purpose: Compares an NBT double value.

Context: Requires NBTAPI and an NBT double tag.

Fields

Field
Default
Description

nbt-double

unset

Entries in path;;key;;operator;;value form, or key;;operator;;value at root.

Example

Behavior and limits

  • Supported operators are >=, >, <=, <, and ==.

  • == uses Java double equality; it does not apply an epsilon tolerance.

  • Integer or float NBT tags do not match an NBT double rule.

  • Invalid paths, types, operators, or values do not produce a match.

Last updated