> 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/ultimatequest-zhong-wen-wen-dang/pei-zhi/conditions/entity-state.md).

# 实体与状态条件

示例写在目标或对应任务字段的 conditions 中。公共字段见[概览](/ultimatequest-zhong-wen-wen-dang/pei-zhi/conditions.md)。

## `sneaking`

选中玩家正在潜行。

| 字段       | 默认值    | 说明                    |
| -------- | ------ | --------------------- |
| `target` | TARGET | 实体选择器，PLAYER 表示任务拥有者。 |
| `value`  | true   | 预期布尔状态。               |

```yaml
conditions:
  sneaking:
    type: sneaking
    target: PLAYER
    value: true
```

要求 Player，缺失或类型不符先返回 false，再执行公共反转。

## `not_sneaking`

选中玩家未潜行。

| 字段       | 默认值    | 说明                    |
| -------- | ------ | --------------------- |
| `target` | TARGET | 实体选择器，PLAYER 表示任务拥有者。 |

```yaml
conditions:
  not_sneaking:
    type: not_sneaking
    target: PLAYER
```

要求 Player，缺失或类型不符先返回 false，再执行公共反转。

## `on_ground`

选中生物在地面。

| 字段       | 默认值    | 说明                    |
| -------- | ------ | --------------------- |
| `target` | TARGET | 实体选择器，PLAYER 表示任务拥有者。 |
| `value`  | true   | 预期布尔状态。               |

```yaml
conditions:
  on_ground:
    type: on_ground
    target: PLAYER
    value: true
```

要求 LivingEntity，缺失或类型不符先返回 false，再执行公共反转。

## `in_air`

选中实体不在地面。

| 字段       | 默认值    | 说明                    |
| -------- | ------ | --------------------- |
| `target` | TARGET | 实体选择器，PLAYER 表示任务拥有者。 |
| `value`  | true   | 预期布尔状态。               |

```yaml
conditions:
  in_air:
    type: in_air
    target: PLAYER
    value: true
```

要求 Entity，缺失或类型不符先返回 false，再执行公共反转。

## `in_water`

选中实体在水中。

| 字段       | 默认值    | 说明                    |
| -------- | ------ | --------------------- |
| `target` | TARGET | 实体选择器，PLAYER 表示任务拥有者。 |
| `value`  | true   | 预期布尔状态。               |

```yaml
conditions:
  in_water:
    type: in_water
    target: PLAYER
    value: true
```

要求 Entity，缺失或类型不符先返回 false，再执行公共反转。

## `in_lava`

选中实体脚下位置方块为 LAVA。

| 字段       | 默认值    | 说明                    |
| -------- | ------ | --------------------- |
| `target` | TARGET | 实体选择器，PLAYER 表示任务拥有者。 |
| `value`  | true   | 预期布尔状态。               |

```yaml
conditions:
  in_lava:
    type: in_lava
    target: PLAYER
    value: true
```

要求 Entity，缺失或类型不符先返回 false，再执行公共反转。

## `game_mode`

匹配选定玩家游戏模式。

| 字段             | 默认值    | 说明                    |
| -------------- | ------ | --------------------- |
| `target`       | TARGET | 实体选择器，PLAYER 表示任务拥有者。 |
| `modes / mode` | —      | 模式名称列表或标量。            |

```yaml
conditions:
  survival:
    type: game_mode
    target: PLAYER
    modes:
    - SURVIVAL
    - ADVENTURE
```

检查任务拥有者用 PLAYER，TARGET 可能是生物、弹射物或缺省。

## `has_potion`

要求足够种类的活动药水效果满足选择器。

| 字段                    | 默认值    | 说明                                    |
| --------------------- | ------ | ------------------------------------- |
| `target`              | TARGET | 实体选择器，PLAYER 表示任务拥有者。                 |
| `potions`             | \[]    | 效果键，或 ALL/BENEFICIAL/HARMFUL/NEUTRAL。 |
| `require-min-effects` | 1      | 最少匹配种类数，至少为 1。                        |

```yaml
conditions:
  boosted:
    type: has_potion
    target: PLAYER
    potions:
    - minecraft:speed
    - minecraft:haste
    require-min-effects: 1
```

检查现有效果，不等同于药水变化事件中的待修改效果，未知选择器不匹配。

## `match_entity`

对选中生物应用实体匹配格式。

| 字段       | 默认值             | 说明                    |
| -------- | --------------- | --------------------- |
| `target` | TARGET          | 实体选择器，PLAYER 表示任务拥有者。 |
| `match`  | current section | 实体匹配规则，默认当前节点。        |

```yaml
conditions:
  zombie:
    type: match_entity
    target: TARGET
    match:
      entity-types:
      - ZOMBIE
```

非生物目标失败。绝对生命下限用 entity-health，未注册 health\_percent 事件条件。
