> 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.md).

# 事件条件

条件决定能否接取任务或让目标事件累计进度，普通 conditions 为 AND，同级具名条目全部满足。UltimateQuest 注册 18 个内置事件条件类型。

## 参考页面

* [🔀 逻辑条件](/ultimatequest-zhong-wen-wen-dang/pei-zhi/conditions/logical.md)
* [🧍 实体与状态条件](/ultimatequest-zhong-wen-wen-dang/pei-zhi/conditions/entity-state.md)
* [🎒 物品条件](/ultimatequest-zhong-wen-wen-dang/pei-zhi/conditions/items.md)
* [🌍 环境与方块条件](/ultimatequest-zhong-wen-wen-dang/pei-zhi/conditions/environment.md)
* [🧾 玩家条件](/ultimatequest-zhong-wen-wen-dang/pei-zhi/conditions/player-conditions.md)

## 公共格式

```yaml
conditions:
  survival:
    type: game_mode
    target: PLAYER
    modes: [SURVIVAL, ADVENTURE]
    not: false
```

| 字段               | 默认值   | 说明                         |
| ---------------- | ----- | -------------------------- |
| type             | 必填    | 已注册条件 ID，字符串注册表标准化大小写与短横线。 |
| not              | false | 反转结果，包括缺失上下文导致的 false。     |
| target           | 按类型   | 仅支持该选项的条件使用实体选择器。          |
| meet-message     | 空     | 成功时发给任务玩家的可选文案。            |
| not-meet-message | 空     | 失败时发给任务玩家的可选文案。            |

## 执行上下文

任务根条件在接取时使用仅含玩家的上下文；目标条件在匹配触发器事件上执行，先于防刷与进度增量计算。TARGET 不自动等于任务拥有者，检查拥有者应显式用 PLAYER。SOURCE、TARGET 由触发器提供，物品/方块/事件数据可能不存在。

未知直接类型拒绝定义加载。通用权限/变量条件放在 player\_conditions 内。缺失数据通常返回 false，但公共 not 可以反转，因此不要把反转当作存在性判断。

## 类型索引

| 类型                  | 参考                                                                                                                |
| ------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `any`               | [any](/ultimatequest-zhong-wen-wen-dang/pei-zhi/conditions/logical.md#any)                                        |
| `not`               | [not](/ultimatequest-zhong-wen-wen-dang/pei-zhi/conditions/logical.md#not)                                        |
| `sneaking`          | [sneaking](/ultimatequest-zhong-wen-wen-dang/pei-zhi/conditions/entity-state.md#sneaking)                         |
| `not_sneaking`      | [not\_sneaking](/ultimatequest-zhong-wen-wen-dang/pei-zhi/conditions/entity-state.md#not_sneaking)                |
| `on_ground`         | [on\_ground](/ultimatequest-zhong-wen-wen-dang/pei-zhi/conditions/entity-state.md#on_ground)                      |
| `in_air`            | [in\_air](/ultimatequest-zhong-wen-wen-dang/pei-zhi/conditions/entity-state.md#in_air)                            |
| `in_water`          | [in\_water](/ultimatequest-zhong-wen-wen-dang/pei-zhi/conditions/entity-state.md#in_water)                        |
| `in_lava`           | [in\_lava](/ultimatequest-zhong-wen-wen-dang/pei-zhi/conditions/entity-state.md#in_lava)                          |
| `game_mode`         | [game\_mode](/ultimatequest-zhong-wen-wen-dang/pei-zhi/conditions/entity-state.md#game_mode)                      |
| `has_potion`        | [has\_potion](/ultimatequest-zhong-wen-wen-dang/pei-zhi/conditions/entity-state.md#has_potion)                    |
| `match_entity`      | [match\_entity](/ultimatequest-zhong-wen-wen-dang/pei-zhi/conditions/entity-state.md#match_entity)                |
| `match_item`        | [match\_item](/ultimatequest-zhong-wen-wen-dang/pei-zhi/conditions/items.md#match_item)                           |
| `catch_match_item`  | [catch\_match\_item](/ultimatequest-zhong-wen-wen-dang/pei-zhi/conditions/items.md#catch_match_item)              |
| `world`             | [world](/ultimatequest-zhong-wen-wen-dang/pei-zhi/conditions/environment.md#world)                                |
| `block_type`        | [block\_type](/ultimatequest-zhong-wen-wen-dang/pei-zhi/conditions/environment.md#block_type)                     |
| `night`             | [night](/ultimatequest-zhong-wen-wen-dang/pei-zhi/conditions/environment.md#night)                                |
| `storm`             | [storm](/ultimatequest-zhong-wen-wen-dang/pei-zhi/conditions/environment.md#storm)                                |
| `player_conditions` | [player\_conditions](/ultimatequest-zhong-wen-wen-dang/pei-zhi/conditions/player-conditions.md#player_conditions) |
