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

# 环境与方块条件

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

## `world`

检查上下文位置的世界。

| 字段               | 默认值 | 说明                   |
| ---------------- | --- | -------------------- |
| `worlds / world` | —   | 世界名称列表或标量，比较时标准化大小写。 |

```yaml
conditions:
  overworld:
    type: world
    worlds:
    - world
```

事件位置可能在目标/方块，不一定在玩家处。直接检查玩家世界可用嵌套 player\_conditions。

## `block_type`

通过原版/自定义方块钩子匹配事件方块。

| 字段                  | 默认值 | 说明         |
| ------------------- | --- | ---------- |
| `types / type-name` | —   | 方块标识列表或标量。 |

```yaml
conditions:
  stone:
    type: block_type
    types:
    - STONE
```

优先用存在的 brokenBlockState，否则读取实时上下文方块；没有方块时失败。该条件本身不判断作物成熟。

## `night`

检查来源生物所在世界时间。

| 字段      | 默认值  | 说明      |
| ------- | ---- | ------- |
| `value` | true | 预期布尔状态。 |

```yaml
conditions:
  dark:
    type: night
    value: true
```

夜晚为 12300–23850 tick（包含边界）。读取 SOURCE，不支持 target 字段。

## `storm`

检查上下文位置世界是否有风暴。

| 字段      | 默认值  | 说明      |
| ------- | ---- | ------- |
| `value` | true | 预期布尔状态。 |

```yaml
conditions:
  rain:
    type: storm
    value: true
```

没有位置/世界时失败，value: false 要求没有风暴。
