> 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/identity-state.md).

# Identity and State Rules

Every rule on this page is a key inside a [MatchEntityFormat](/format/match-entity-format.md) section.

***

## `entity-types`

**Purpose:** Matches the Bukkit entity type.

**Context:** The candidate must be a living entity.

### Fields

| Field          | Default | Description                                              |
| -------------- | ------- | -------------------------------------------------------- |
| `entity-types` | empty   | Accepted Bukkit `EntityType` enum names. Entries use OR. |

### Example

```yaml
match-entity:
  entity-types:
    - ZOMBIE
    - WITHER_SKELETON
```

### Behavior and limits

* Comparison is case-insensitive.
* Values are compared with Bukkit enum names, not namespaced registry keys.
* One matching entity type is sufficient.

***

## `none`

**Purpose:** Forces the MatchEntityFormat section to fail.

**Context:** No entity property is inspected.

### Fields

| Field  | Default | Description                                                      |
| ------ | ------- | ---------------------------------------------------------------- |
| `none` | unset   | Presence of this key activates the always-fail rule. Use `true`. |

### Example

```yaml
match-entity:
  none: true
```

### Behavior and limits

* Useful for disabling a branch without deleting it.
* Because same-level rules use AND, an active `none` makes the whole section fail.
* The current implementation contains two internal handlers for this key; use only `none: true` and do not rely on `none: false` as an inversion rule.

***

## `entity-contains-name`

**Purpose:** Matches text contained in the entity's resolved name.

**Context:** Uses EnchantedMobs' entity-name resolver, which can include a custom name.

### Fields

| Field                  | Default | Description                              |
| ---------------------- | ------- | ---------------------------------------- |
| `entity-contains-name` | empty   | Accepted name fragments. Entries use OR. |

### Example

```yaml
match-entity:
  entity-contains-name:
    - Elite
    - Guardian
```

### Behavior and limits

* Formatting is removed from both the entity name and configured text.
* The remaining substring comparison is case-sensitive.
* One fragment is sufficient.
* Prefer stable tags, PDC, entity types, or plugin IDs when names can be localized or changed by another plugin.

***

## `entity-health`

**Purpose:** Requires a minimum current health value.

**Context:** Reads the living entity's current health, not maximum health or health percentage.

### Fields

| Field           | Default | Description                       |
| --------------- | ------- | --------------------------------- |
| `entity-health` | unset   | Inclusive minimum current health. |

### Example

```yaml
match-entity:
  entity-health: 40
```

### Behavior and limits

* The comparison is `current health >= configured value`.
* There is no built-in maximum or percentage form in this rule.
* For more complex runtime checks inside a power, use the typed health Power Conditions.

***

## `entity-tag`

**Purpose:** Matches a Bukkit entity-type tag or the special monster classification.

**Context:** Uses the server's entity-type tag registry.

### Fields

| Field        | Default | Description                                                                        |
| ------------ | ------- | ---------------------------------------------------------------------------------- |
| `entity-tag` | empty   | Accepted namespaced entity tags. Entries use OR. The literal `monster` is special. |

### Example

```yaml
match-entity:
  entity-tag:
    - minecraft:skeletons
    - monster
```

### Behavior and limits

* The exact lowercase value `monster` checks `entity instanceof org.bukkit.entity.Monster`.
* Other values are parsed as namespaced keys and looked up in Bukkit's entity-type tag registry.
* A missing or invalid tag does not match, but later entries are still checked.
* One matching tag is sufficient.

***

## `entity-pdc`

**Purpose:** Matches values stored in the entity's Bukkit `PersistentDataContainer`.

**Context:** Keys must be valid namespaced keys and must be stored as a supported Bukkit persistent-data type.

### Fields

| Field                         | Default | Description                                                             |
| ----------------------------- | ------- | ----------------------------------------------------------------------- |
| `entity-pdc.<namespaced-key>` | unset   | Expected string, numeric expression, or boolean. Different keys use OR. |

### Examples

```yaml
match-entity:
  entity-pdc:
    myplugin:class: warrior
    myplugin:level: '>=10'
    myplugin:boss: true
```

Numeric range:

```yaml
match-entity:
  entity-pdc:
    myplugin:level: '10~20'
```

String wildcard:

```yaml
match-entity:
  entity-pdc:
    myplugin:variant: 'fire_*'
```

### Supported stored types

| Stored type                          | Matching behavior                                                                                           |
| ------------------------------------ | ----------------------------------------------------------------------------------------------------------- |
| `STRING`                             | Case-insensitive equality or containment; `*` enables a case-insensitive regular-expression-style wildcard. |
| `INTEGER`, `DOUBLE`, `LONG`, `FLOAT` | Numeric comparison.                                                                                         |
| `BYTE`                               | Treated as boolean: zero is `false`, non-zero is `true`.                                                    |

Numeric rules support:

* `5~10` — inclusive range;
* `>=5`, `>5`, `<=5`, `<5`;
* `=5` or `5` — equality with a `0.0001` tolerance.

### Behavior and limits

* Configured PDC keys use OR; the first matching key passes the rule.
* For string values, plain text also performs case-insensitive substring matching. Configuring `war` matches `warrior`.
* `*` is converted directly to `.*`; other regular-expression characters are not escaped.
* Unsupported PDC types such as arrays and nested containers do not match.
* Invalid numeric expressions fail safely.

***

## `ranged`

**Purpose:** Checks whether the entity is treated as a ranged attacker.

**Context:** Inspects the main-hand item and, on Paper, the `RangedEntity` interface.

### Fields

| Field    | Default | Description                                                           |
| -------- | ------- | --------------------------------------------------------------------- |
| `ranged` | unset   | `true` requires ranged classification; `false` requires the opposite. |

### Example

```yaml
match-entity:
  ranged: true
```

### Behavior and limits

* A supported ranged weapon is `BOW`, `CROSSBOW`, or `TRIDENT` in the main hand.
* On Paper, an entity that does not implement Paper's `RangedEntity` is not considered ranged even when holding one of those items.
* On non-Paper implementations, the main-hand weapon check is used without the Paper interface requirement.
* The rule describes current equipment/classification, not whether the entity is currently attacking at range.

***

## `monster`

**Purpose:** Checks Bukkit's hostile-monster class.

**Context:** Uses `entity instanceof org.bukkit.entity.Monster`.

### Fields

| Field     | Default | Description                                                              |
| --------- | ------- | ------------------------------------------------------------------------ |
| `monster` | unset   | `true` requires a monster; `false` requires a non-monster living entity. |

### Example

```yaml
match-entity:
  monster: false
```

### Behavior and limits

* This is a Bukkit class check, not a check for aggression, target state, or team hostility.
* Some dangerous or boss entities may not implement Bukkit's `Monster` interface; use `entity-types` or `entity-tag` when exact coverage matters.
* The rule is active whenever the key exists, including when set to `false`.
