完整版BedrockWiki镜像!

This commit is contained in:
boybook
2025-03-20 11:52:46 +08:00
parent 1994c41f01
commit bf9aa4b056
214 changed files with 9042 additions and 8867 deletions

View File

@@ -1,10 +1,10 @@
---
title: Intro to World Generation
category: General
title: 世界生成入门
category: 基础
nav_order: 1
tags:
- guide
- experimental
- 指南
- 实验性功能
mentions:
- SirLich
- solvedDev
@@ -16,28 +16,31 @@ mentions:
- SmokeyStack
---
# 世界生成入门
<!--@include: @/wiki/bedrock-wiki-mirror.md-->
:::warning
This page is somewhat out-dated, and contains limited information. For the most up-to-date and comprehensive information, view the other pages in this section.
本文档部分内容已过时,信息量有限。如需获取最新最全面的信息,请查阅本节其他页面。
:::
You can change the world's generation via Add-ons. The needed folders in the Behavior pack for these are:
您可以通过附加包修改世界的生成规则。行为包中需要以下文件夹:
`structures`, `features`, `feature_rules` and `biomes`. It's quite self-explanatory: you can store your .mcstructure files from (or for) structure blocks in `structures`, biome files in `biomes`, terrain features, like ores, in `features` and the rules for their generation in `feature_rules`. Let's go over adding a custom biome first.
`structures`(结构)、`features`(特征)、`feature_rules`(特征规则)和 `biomes`(生物群系)。顾名思义:您可以将结构方块生成的.mcstructure文件存放在`structures`中,生物群系文件存放在`biomes`中,矿石等地形特征存放在`features`中,其生成规则则存放在`feature_rules`中。让我们先从添加自定义生物群系开始。
_Note: it might be easier to create biomes using bridge., a Visual software for Add-on creation (also linked in Links and Contact), since the official Documentation is rather incomplete. You can also generate all example files of vanilla biomes, features and feature rules for reference, like shown here:_
_注:使用 bridge. 这款可视化附加包创作工具(联系方式见"链接与联系")创建生物群系可能更方便,因为官方文档尚不完善。您也可以生成所有原版生物群系、特征和特征规则的示例文件作为参考,如下图所示:_
![](/assets/images/guide/gen_coal_ore.png)
_Generating a coal_ore feature using bridge._
_使用 bridge. 生成 coal_ore 特征_
However, bridge. is not required.
当然bridge. 并非必需工具。
---
## Custom Biomes
## 自定义生物群系
<CodeHeader>BP/biomes/cold_biome.json</CodeHeader>
```json
::: code-group
```json [BP/biomes/cold_biome.json]
{
"format_version": "1.13.0",
"minecraft:biome": {
@@ -74,76 +77,71 @@ However, bridge. is not required.
}
```
- Set `format_version` to 1.13.0: it's the latest biome file version as of the current release.
- `description` takes only one value: `identifier`. This requires **NO namespace** and **MUST** be the same as the **file's name**.
(If you do use a namespace, for example `wiki:cold_biome`, the file name needs to only match the id, so it has to remain as `cold_biome.json`.
- `components` is just what you'd expect: something applied to the biome at default. let's look through them:
- `minecraft:climate` controls everything climate-wise.
- `downfall` is how often it'll be raining or snowing. 0.0 is for absolutely no rain (like a desert) and 1.0 should mean constant rain.
- `temperature` is used to define things like water freezing and rain turning into snow.
- 设置 `format_version` 为 1.13.0:这是当前版本的最新生物群系文件格式
- `description` 仅需一个值:`identifier`。此处**不需要命名空间**且**必须**与**文件名**一致
(如果使用命名空间,例如 `wiki:cold_biome`,文件名仍需保持为 `cold_biome.json`
- `components` 即生物群系的基本属性配置,让我们逐一解析:
- `minecraft:climate` 控制气候相关参数
- `downfall` 表示降水频率。0.0 代表无降水如沙漠1.0 表示持续降水
- `temperature` 用于定义水体结冰和降雨转雪等效果
**You can generate default biome files for reference using bridge.**
**可使用 bridge. 生成原版生物群系文件作为参考**
- `overworld_surface` controls blocks generated.
- `floor_depth` is how deep down lakes and rivers go in blocks.
- `sea_floor_material` defines the material to be used when generating the river and lake's floor.
- `foundation_material` is the material to be used approximately between y=5 and y=50. For a desert, for example, it's stone.
- `sea_material` is the material used as show liquid in lakes, rivers, oceans, etc. For example, in all Overworld biomes, this is set to "minecraft:water".
- `top_material` defines the material for the highest level. E.g for Plains it's grass.
- `mid_material` is the layer between 'top' and 'foundation'. For Plains it's dirt.
- `overworld_height` defines how the Biome will look terrain-wise.
- `overworld_surface` 控制地形生成材质
- `floor_depth` 表示湖泊河流的底部深度(方块数)
- `sea_floor_material` 定义水域底部材质
- `foundation_material` 用于 y=5 y=50 之间的基础岩层(例如沙漠使用石头)
- `sea_material` 水域液体材质(主世界通常设为 "minecraft:water"
- `top_material` 表层材质(如草方块用于平原)
- `mid_material` 中间层材质(如泥土用于平原)
- `overworld_height` 定义地形高度特征
DO NOT use both `noise_type` and `noise_params` at the same time. `noise_params` is an array of the top level of noise and the lowest level of noise allowed in the biome.
不可同时使用 `noise_type` 和 `noise_params`。`noise_params` 是包含噪声最高值和最低值的数组
![](/assets/images/guide/non_smooth_noise_transition.jpg)
_A non-smooth transition between the same biome, generated with noise_params as [0.1, 0,1] and then [1.0, 1.0]._
_使用 noise_params [0.1, 0.1] [1.0, 1.0] 生成的同生物群系非平滑过渡示例_
- If you want to use `noise_type`, however, you will be presented with a few pre-generated types of noise. You will probably know how some of them look from the Vanilla game. Here's the list:
- 若使用 `noise_type`,可选预设值包括:
`beach, default, extreme, taiga, ocean, mountains, default_mutated, deep_ocean, lowlands, less_extreme, stone_beach, swamp, river, mushroom`
`beach, default, extreme, taiga, ocean, mountains, default_mutated, deep_ocean, lowlands, less_extreme, stone_beach, swamp, river, mushroom`.
- `minecraft_world_generation_rules` 是最重要的组件,特别是 `generate_for_climates` 数组。游戏中有三种气候:"warm"、"medium" 和 "cold"。在世界生成时这些气候会随机分布[硬编码]。您可以为每个气候设置生物群系的生成权重。若不设置默认权重为0生物群系不会生成。示例中测试时将各气候权重设为100使该生物群系在主世界广泛生成。正式使用时需调整权重例如原版沙漠在warm气候中的权重为3
- `minecraft_world_generation_rules` is the most important component of all, especially the `generate_for_climates` array. Basically, there are three climates in the game: "warm", "medium" and "cold". They are randomly thrown around every world when it's created [hard-coded]. Now, you can choose how often your custom biome will generate in every specific climate. If you do not provide anything in here, the default value is 0 for every climate, and the biome won't generate. In the example, the **weight** (the smaller the number, the smaller the chance of this biome generating instead of a vanilla one in the climate) for every climate is set to 100 for testing purposes: that makes the biome generate almost everywhere in the Overworld. Once I'm done with testing, however, I'll balance the weight how it's supposed to be. For example, the Vanilla _desert_ has the weight of 3 for warm.
- This component also takes Objects such as: `hills_transformation`, `mutate_transformation`, `shore_transformation`, `river_transformation`, but their meaning is unclear to me. Contributions are always appreciated. Same goes for the `surface_meaterial_adjustments` component.
- And, last but not least, BIOME TAGS! They're very simple, but useful. You can set however many of the vanilla or custom tags you want, by adding them in this format in `components`:
- 该组件还包含 `hills_transformation`、`mutate_transformation`、`shore_transformation`、`river_transformation` 等参数,具体含义尚不明确。欢迎补充说明。`surface_meaterial_adjustments` 组件同理
- 最后是生物群系标签!使用方式简单但实用。通过在 `components` 中添加如下格式的标签:
```
"tagName": {}
```
即可在环境传感器、过滤器、生物群系检测、生成规则等场景中使用该标签
Then, you can test for your tag in _environment_sensors_, _filters_, _has_biome_ tests, _spawn rules_, and more.
Your custom biome is now complete!
至此,您的自定义生物群系已创建完成!
---
## Features and Feature Rules
## 特征与特征规则
Note: in v.1.15Beta, it is possible to use `.mcstructures` from the `structures` folder instead of `features` to generate custom structures with `feature_rules`. More on that after the update arrives.
注:在 v1.15Beta 中,可使用 `structures` 文件夹中的 `.mcstructures` 配合 `feature_rules` 生成自定义结构。更多详情将在更新发布后补充
Features and Feature Rules are used to generate everything from ores to grass and flowers, vegetation to granite or clay patches.
It is even possible to create custom structures using those, but as it is very grindy and will be much easier after the mentioned update, we won't talk about it just yet.
特征与特征规则用于生成矿石、花草、植被、花岗岩或黏土矿脉等各类地形元素。虽然目前可用其创建自定义结构,但操作繁琐,建议等待后续更新简化流程
Now, it's worthwhile to mention that the easiest way to generate Custom Structures is this [auto generator](https://machine-builder.itch.io/frg-v2) by [MACHINE_BUILDER](https://www.youtube.com/channel/UC8FBQgo4AWwKFX97h60NKOQ), you should note that this tool has a free version with limited functionality and to enjoy the full functionality use the payware version. However, we'll still learn some other manual feature generation here, because some things like Ores are much more efficient to generate as `ore_feature`s and not `structure_template_feature`s.
推荐使用 [MACHINE_BUILDER](https://www.youtube.com/channel/UC8FBQgo4AWwKFX97h60NKOQ) 开发的[自动生成工具](https://machine-builder.itch.io/frg-v2)来创建自定义结构。该工具免费版功能有限,完整功能需购买专业版。不过我们仍将学习手动创建特征的方法,因为矿石等元素使用 `ore_feature` 比 `structure_template_feature` 更高效
Let's make our `wiki:blocky` custom block generate as an ore for the tutorial's sake. I'll do it the easy way, like this:
让我们以生成自定义方块 `wiki:blocky` 的矿石为例:
1. Open _bridge._, choose your Add-on.
1. _Add new file>features>diamond_ore and Add new file>feature_rules>diamond_ore_.
1. Now I'll save the files and open them in my Code Editor and make the necessary modifications.
1. 打开 bridge. 选择附加包
1. 新建文件 > features > diamond_ore feature_rules > diamond_ore
1. 保存文件后用代码编辑器进行必要修改
_You could've easily just written the files from scratch or copied them from somewhere without using bridge. in case you are having trouble installing it. **One place to find the Vanilla Files are the [Example Packs](https://www.minecraft.net/en-us/addons), another, a more complete one is [bridge.'s repository](https://github.com/bridge.-core/bridge../tree/master/static/vanilla)**._
_若无安装 bridge.,也可手动创建或从[示例包](https://www.minecraft.net/en-us/addons)或 [bridge. 仓库](https://github.com/bridge.-core/bridge../tree/master/static/vanilla)获取原版文件_
## Features
## 特征
Features are located in `BP/features` and are basically a group of blocks stored in the game's files, which can be placed with a _feature_rule_. The **file name** of a _feature_ **must match** the **identifier** as well.
特征文件位于 `BP/features` 目录,本质上是游戏中可被特征规则放置的区块集合。**文件名**必须与**标识符**匹配
You can find their Documentation on [bedrock.dev/r/Features](https://bedrock.dev/r/Features)
完整文档请参考 [bedrock.dev/r/Features](https://bedrock.dev/r/Features)
<CodeHeader>BP/features/blocky_ore_feature.json</CodeHeader>
```json
::: code-group
```json [BP/features/blocky_ore_feature.json]
{
"format_version": "1.13.0",
"minecraft:ore_feature": {
@@ -200,19 +198,18 @@ You can find their Documentation on [bedrock.dev/r/Features](https://bedrock.dev
}
```
- `minecraft_ore_feature` is type of the specific feature that places ores automatically. Each feature type has it's own specific syntax. (There's also `single_block_feature` that places a single block instead of an ore group, etc)
- `identifier` doesn't require a namespace in this scenario. The namespace is optional, and is not to be added in the filename.
- `count` is how big the ore "cluster" will be at maximum, or how many actual ore blocks will generate together.
- `places_block` takes the identifier of the block to be placed as the value.
- `may_replace` takes all the blocks that the feature can replace as arguments. If it generates over one of the blocks not included in here, the block will remain where it was without being replaced.
- `minecraft_ore_feature` 是自动生成矿石的特定特征类型。每种特征类型都有独特语法(另有 `single_block_feature` 用于生成单个方块等)
- `identifier` 此处不需要命名空间。文件名不包含命名空间
- `count` 表示矿簇的最大方块数
- `places_block` 设置要生成的方块标识符
- `may_replace` 列出可被替换的方块类型。遇到未列出的方块时将保留原方块
## Feature Rules
## 特征规则
**Feature Rules** control where and how _features_ (and, in the future, _structures_) are placed.
**特征规则**控制特征(及未来的结构)的生成位置和方式
<CodeHeader>BP/feature_rules/overworld_underground_blocky_ore_feature.json</CodeHeader>
```json
::: code-group
```json [BP/feature_rules/overworld_underground_blocky_ore_feature.json]
{
"format_version": "1.13.0",
"minecraft:feature_rules": {
@@ -260,42 +257,36 @@ You can find their Documentation on [bedrock.dev/r/Features](https://bedrock.dev
```
- `description`
- `identifier` needs no namespace, but the filename needs to match.
- `places_feature` takes the identifier of the feature that is controlled by this rule as the value.
- `identifier` 不需要命名空间,但文件名需匹配
- `places_feature` 设置要控制的特征标识符
- `conditions`
- `placement_pass` HOW the feature will be passed.
- `biome_filter` tests for biome tags where the feature will generate, exactly as a spawn rule.
- `placement_pass` 控制特征生成阶段
- `biome_filter` 通过生物群系标签过滤生成位置(与生成规则类似)
- `distribution`
- `iterations` basically chance. I set mine to 100 to make it generate everywhere, but for a diamond_ore, this is set to 1.
- The next four components show in which directions the ore will be 'dragged' towards.
_Needs more clarification_
- `iterations` 生成概率。设为100表示全图生成钻石矿通常设为1
- 后续参数控制矿脉延伸方向(需要更多说明)
The easiest way to test wether your ores generated is /fill ~15 ~5 ~15 ~-15 ~-15 ~-15 air 0 replace stone using this command at a low y level. it'll keep everything BUT stone in the selected area, like this:
测试矿石生成建议在低Y坐标使用指令 `/fill ~15 ~5 ~15 ~-15 ~-15 ~-15 air 0 replace stone`,该指令会清除选定区域内所有石头,保留其他方块:
![](/assets/images/guide/ore_gen_sans_stone.jpg)
And yes, 100 as "iterations" is definitely waaay too much ;)
显然,将"iterations"设为100确实过量 ;)
It's a good idea to proceed checking out other feature and feature_rule vanilla files to learn further techniques. However, the ones you were just walked through are enough to create most of what needs to be generated.
建议通过研究原版特征和特征规则文件来学习更多技巧。不过上文所述内容已能满足大部分生成需求
---
## Custom Structures
## 自定义结构
As of MCBE v1.16.20, **Custom Generated structures are possible**.
A simple way to generate Structures is [this](https://machine-builder.itch.io/frg-v2) auto generator by MACHINE_BUILDER, mentioned earlier. It generates all three of the required files for your structure: `feature_rules/mystructure.feature_rule.json`, `feature_rules/mystructure.feature.json` and `structures/mystructure.mcstructure.` You can learn more about defining `.mcstructures` with Structure Blocks in Minecraft itself [here](/nbt/mcstructure).
MCBE v1.16.20 起,**支持自定义生成结构**
推荐使用前文提到的 [MACHINE_BUILDER 工具](https://machine-builder.itch.io/frg-v2)自动生成结构文件。该工具会生成三个必要文件:`feature_rules/mystructure.feature_rule.json`、`feature_rules/mystructure.feature.json` 和 `structures/mystructure.mcstructure`。更多关于使用结构块定义 `.mcstructure` 的内容请参考[此文档](/wiki/nbt/mcstructure)
---
Now that you have your `.mcstructure`, time to write your `feature` and `feature rule`. The last is the same as with ores (see the beginning of this article). Let's continue to the **Feature**.
准备好 `.mcstructure` 文件后,需要编写对应的 `feature` 和 `feature rule`。特征规则与矿石生成类似(参见前文),以下是**特征**示例(来自[特征文档](https://bedrock.dev/r/Features#minecraft:structure_template_feature)
- Remember that the namespace is not required and that the filename must match the identifier, excluding the namespace. So if you have a feature rule with the identifier `wiki:myfeaturerule` or simply `myfeaturerule`, the file name can be be `myfeaturerule.json` in both cases.
Here's an code example from the [Features Documentation](https://bedrock.dev/r/Features#minecraft:structure_template_feature):
<CodeHeader></CodeHeader>
```json
::: code-group
```json [示例]
{
"format_version": "1.13.0",
"minecraft:structure_template_feature": {
@@ -317,24 +308,22 @@ Here's an code example from the [Features Documentation](https://bedrock.dev/r/F
}
```
- `structure_name` is the structure's identifier, the one you saved via a Structure Block.
- `structure_name` 是结构块的保存标识符
That's pretty much it! Now you're able to generate your own custom Structures in the world.
至此,您已掌握在游戏中生成自定义结构的方法!
---
---
## 当前进度
## Your progress so far
**What you've done:**
**已完成内容:**
<Checklist>
- [x] Created you very first biome.
- [x] Made your very first ore generate naturally.
- [x] Learned to use bridge. for vanilla files generation and referencing.
- [x] Learned about other Custom Generation methods.
- [x] Created custom Structures
- [x] 创建第一个生物群系
- [x] 实现首个自然生成的矿石
- [x] 掌握使用 bridge. 生成原版参考文件
- [x] 了解其他自定义生成方法
- [x] 创建自定义结构
</Checklist>
</Checklist>