> For the complete documentation index, see [llms.txt](https://enchantedmobs.superiormc.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://enchantedmobs.superiormc.cn/format/match-entity-format.md).

# Match Entity Format

`MatchEntityFormat` is the shared configuration format used whenever EnchantedMobs needs to test a living entity.

It is used by power-generation `match-entity` sections, the `match_entity` Power Condition, and abilities such as `nearby_entities` that filter candidate entities.

```yaml
match-entity:
  entity-types:
    - ZOMBIE
    - SKELETON
  entity-health: 20
```

The example matches a zombie or skeleton whose current health is at least 20.

## Evaluation rules

A MatchEntityFormat section does not use a `type` field. Each recognized key enables one rule.

Rules on the same level use **AND**:

```yaml
match-entity:
  monster: true
  ranged: true
  entity-health: 10
```

The entity must be a Bukkit monster, must satisfy the ranged check, and must currently have at least 10 health.

Within most list-based rules, entries use **OR**.

### Empty and invalid inputs

* A missing MatchEntityFormat section matches everything.
* A missing entity does not match.
* MatchEntityFormat accepts `LivingEntity`; non-living entities cannot be evaluated by this matcher.
* An unrecognized key is ignored.
* `none: true` forces the section to fail.

## Logical composition

Use numbered `any` groups for alternatives that contain several rules:

```yaml
match-entity:
  any:
    1:
      entity-types:
        - SKELETON
      ranged: true
    2:
      mythicmobs:
        - SkeletonKing
```

Use `not` to reject any entity matching a nested rule:

```yaml
match-entity:
  monster: true
  not:
    entity-types:
      - CREEPER
    entity-tag:
      - minecraft:bosses
```

See [Logical Rules](/format/match-entity-format/logic.md) for exact `any` and `not` behavior.

## Nested equipment matching

The `equip` rule contains one [MatchItemFormat](/format/match-item-format.md) section per equipment slot:

```yaml
match-entity:
  equip:
    main-hand:
      material-tag:
        - minecraft:swords
    helmet:
      material:
        - carved_pumpkin
```

Configured equipment slots use OR: matching either the main hand or helmet is enough for the `equip` rule to pass.

## Optional rule availability

| Rule                                   | Requirement                                                                                    |
| -------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `mythicmobs`                           | MythicMobs must be loaded when EnchantedMobs starts.                                           |
| `levelled-mobs`                        | LevelledMobs must be loaded when EnchantedMobs starts.                                         |
| Paper-specific `ranged` classification | On Paper, the entity must implement Paper's `RangedEntity` and hold a supported ranged weapon. |

Unavailable integration rules are not registered. Their keys are ignored rather than treated as a failed match.

## Rule index

| Rule key               | Reference                                                                                              |
| ---------------------- | ------------------------------------------------------------------------------------------------------ |
| `entity-types`         | [Identity and State Rules](/format/match-entity-format/identity-state.md#entity-types)                 |
| `none`                 | [Identity and State Rules](/format/match-entity-format/identity-state.md#none)                         |
| `entity-contains-name` | [Identity and State Rules](/format/match-entity-format/identity-state.md#entity-contains-name)         |
| `entity-health`        | [Identity and State Rules](/format/match-entity-format/identity-state.md#entity-health)                |
| `entity-tag`           | [Identity and State Rules](/format/match-entity-format/identity-state.md#entity-tag)                   |
| `entity-pdc`           | [Identity and State Rules](/format/match-entity-format/identity-state.md#entity-pdc)                   |
| `ranged`               | [Identity and State Rules](/format/match-entity-format/identity-state.md#ranged)                       |
| `monster`              | [Identity and State Rules](/format/match-entity-format/identity-state.md#monster)                      |
| `equip`                | [Equipment and Integration Rules](/format/match-entity-format/equipment-integrations.md#equip)         |
| `mythicmobs`           | [Equipment and Integration Rules](/format/match-entity-format/equipment-integrations.md#mythicmobs)    |
| `levelled-mobs`        | [Equipment and Integration Rules](/format/match-entity-format/equipment-integrations.md#levelled-mobs) |
| `any`                  | [Logical Rules](/format/match-entity-format/logic.md#any)                                              |
| `not`                  | [Logical Rules](/format/match-entity-format/logic.md#not)                                              |

## Complete example

```yaml
match-entity:
  monster: true
  entity-health: 20
  any:
    1:
      ranged: true
      equip:
        main-hand:
          material:
            - bow
            - crossbow
    2:
      mythicmobs:
        - SkeletonKing
  not:
    entity-types:
      - CREEPER
```

The entity must be a monster with at least 20 current health. It must either be a ranged bow/crossbow user or the MythicMob `SkeletonKing`, and it must not be a creeper.

## Related references

* [MatchItemFormat](/format/match-item-format.md): item rules used by `equip`.
* [Power Conditions](/configs/power-conditions.md): the `match_entity` condition selects a trigger-context entity and applies this format.
* [Abilities](/configs/info-of-abilities.md): `nearby_entities` uses MatchEntityFormat to filter nearby living entities.
* [Mechanics](/configs/mechanic.md): power generation uses `apply-rules.match-entity`.
