# 世界生成

在设置完一个方块后，我们可以让它随机的生成在世界中。

### 世界生成配置

在任意物品配置文件（是大的物品配置下，而不是单独的物品id下的配置，后续不再说明）中添加如下内容：

```
worlds_populators:
  custom_block:
    block: myitems:custom_block
    worlds:
    - world
    replaceable_blocks:
    - STONE
    - DIRT
    - ANDESITE
    - GRANITE
    - COBBLESTONE
    - GRAVEL
    biomes:
    - PLAINS
    chunk_chance: 70.0
    max_height: 45
    min_height: 25
    vein_blocks: 6
    chunk_veins: 1
  custom_block_2:
    block: myitems:custom_block_2
    worlds:
    - world
    replaceable_blocks:
    - DIRT
    chunk_chance: 100.0
    max_height: 64
    min_height: 40
    vein_blocks: 3
    chunk_veins: 1
```

所给的示例配置中包含 **2** 个生成规则。其中，`custom_block` 和 `custom_block_2` 为生成规则的id，其下为生成规则的配置，包括：

* block：该生成规则所指代的方块。
* worlds：该生成规则所生效的世界，可以添加无数多的世界。
* replaceable\_blocks：该生成规则所替换的方块，可以添加无数多的方块，只能为原版方块id。
* chunk\_chance：各个区块在生成时使用该生成规则的概率，`100` 即代表生成新的区块时必定使用 **1** 次该规则，也就是在合适情况下必定会至少有 **1** 个指代的方块被生成。除非该方块你将设置特别稀有，否则请保持 `100`。
* chunk\_veins：在区块使用该生成规则后，该区块将会随机生成的矿脉数量。
* vein\_blocks：在生成矿脉后，该矿脉拥有的指代方块的数量。
* 在上面配置中，1个区块必定有1个矿脉，1个矿脉有3个指代的方块，所以每个区块都会有3个这样的矿石。
* biomes：该生成规则所生效的生物群系，将该配置移除则代表所有生物群系都将会生成。
* min\_height：该生成规则的最低高度。
* max\_height：该生成规则的最高高度。


---

# 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/itemsadder-doc/fang-kuai/shi-jie-sheng-cheng.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.
