# 自定义生成规则

## 什么是自定义生成规则？

自定义生成规则与自定义事件配套，允许服主配置事件生成的自定义怪物的生成规则。

## 示例生成规则

自定义生成规则的配置都在 `custmspawns` 文件夹，一个生成规则可以被多个事件同时使用，所以你不必为每个事件的同样怪物一个一个单独设置生成规则。

这是一个生成规则示例：

```
isEnabled: true
validWorldTypes:
- NORMAL
- CUSTOM
bypassWorldGuard: false
isSurfaceSpawn: true
```

### 必须配置选项

无。当没有配置选项时，自定义怪物将会随机生成。

### 可选配置选项

#### `isEnabled`

`isEnabled` 设置是否启用该自定义生成规则。

#### `lowestYLevel`

`lowestYLevel` 设置该自定义怪物生成的最低坐标，例如 `lowestLevel: 64`。

#### `highestYLevel`

`highestYLevel` 设置该自定义怪物生成的最高坐标，例如 `highestYLevel: 100`。

#### `validWorlds`

`validWorlds` 设置自定义怪物将会生成的世界，例如：

```
validWorlds:
- world
- world_nether
```

#### `validWorldEnvironment`

`validWorldEnvironment` 设置自定义怪物将会生成的维度，有 NORMAL（主世界）、NETHER（下界）和 END（末地）。

```
validWorldTypes:
- NORMAL 
```

#### `validBiomes`

`validBiomes` 设置自定义怪物将会生成的生物群系。

```
validBiomes:
- PLAINS
```

#### `earliestTime`

`earliestTime` 设置自定义怪物将会生成的最早时间，以一天为完整值， tick 为单位，例如 `earliestTime: 100`。

#### `latestTime`

`latestTime` 设置自定义怪物将会生成的最晚时间，以一天为完整值， tick 为单位，例如 `latestTime: 20000`。

#### `moonPhase`

`moonPhase` 设置自定义怪物生成的月周期，例如 `moonPhase: FULL_MOON`。

可以填写： `FULL_MOON` , `WANING_GIBBOUS` , `LAST_QUARTER` , `WANING_CRESCENT` , `NEW_MOON` , `WAXING_CRESCENT` , `FIRST_QUARTER` , `WAXING_GIBBOUS`

#### `bypassWorldGuard`

`bypassWorldguard` 设置自定义怪物生成是否忽视 WorldGuard 的保护，例如 `bypassWorldGuard: true`。

#### `canSpawnInLight`

`canSpawnInLight` 设置自定义怪物是否在有亮光的地方生成，例如 `canSpawnInLight: true`。

#### `isSurfaceSpawn`

`isSurfaceSpawn` 设置自定义怪物是否在地表生成，例如 `isSurfaceSpawn: true`。

#### `isUndergroundSpawn`

`isUndergroundSpawn` 设置自定义怪物是否在地下生成，例如 `isUndergroundSpawn: true`。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.superiormc.cn/elitemobs-wiki/pei-zhi/zi-ding-yi-sheng-cheng-gui-ze.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
