世界与规则组件速查
本页汇总配方、维度、掉落表、生成规则等"世界与规则"类内容的所有组件与字段,标注可选参数,方便快速查阅。
使用方法
- 配方写在行为包
netease_recipes/目录下 - 维度配置写在行为包根目录的
dimensions/下 - 掉落表写在行为包
loot_tables/下 - 生成规则写在行为包
spawn_rules/下
配方类型
| 类型 | format_version | 可选参数 | 说明 | 详细文档 |
|---|---|---|---|---|
minecraft:recipe_shaped | 1.20 | pattern: array(str), key: object(字符→物品映射), result: {item, count}, tags: array(str) | 有序合成 | 自定义配方 |
minecraft:recipe_shapeless | 1.20 | ingredients: array({item/tag}), result: {item, count}, tags: array(str) | 无序合成 | 自定义配方 |
minecraft:recipe_furnace | 1.20 | input: str(物品identifier), output: str(物品identifier), tags: array(str) | 熔炉烧炼 | 自定义配方 |
minecraft:recipe_brewing_mix | 1.20 | input: str, reagent: str, output: str, tags: ["brewing_stand"] | 混合酿造 | 自定义配方 |
minecraft:recipe_brewing_container | 1.20 | input: str, reagent: str, output: str, tags: ["brewing_stand"] | 换容酿造 | 自定义配方 |
minecraft:recipe_smithing_transform | 1.20 | template: str, base: str, addition: str, result: str, tags: ["smithing_table"] | 锻造转换 | 自定义配方 |
minecraft:recipe_smithing_trim | 1.20 | template: str, base: str, addition: str, tags: ["smithing_table"] | 锻造纹饰 | 自定义配方 |
配方标签(tags)
| 标签 | 对应工作站 |
|---|---|
crafting_table | 工作台 |
stonecutter | 切石机 |
cartography_table | 制图台 |
furnace | 熔炉 |
blast_furnace | 高炉 |
smoker | 烟熏炉 |
campfire | 营火 |
brewing_stand | 酿造台 |
smithing_table | 锻造台 |
维度组件(netease:)
| 组件 | 类型 | 可选参数 | 说明 | 详细文档 |
|---|---|---|---|---|
netease:dimension_type | object | overworld / nether / the_end | 维度类型 | 自定义维度 |
netease:generator | object | overworld / nether / the_end / none | 生成器类型 | 自定义维度 |
netease:biome_source | object | 参见维度文档 | 生物群系来源配置 | 自定义维度 |
netease:light_dim | int | 0~15 | 光照衰减 | 自定义维度 |
netease:has_ceiling | bool | true / false | 是否有天花板 | 自定义维度 |
netease:has_skylight | bool | true / false | 是否有天空光照 | 自定义维度 |
netease:has_weather | bool | true / false | 是否有天气 | 自定义维度 |
netease:coordinate_scale | float | 如 1.0, 8.0(下界) | 坐标缩放比例 | 自定义维度 |
掉落表结构
顶层字段
| 字段 | 类型 | 可选参数 | 说明 |
|---|---|---|---|
pools | array | 掉落池对象数组 | 掉落池列表 |
random_sequence | str | 任意字符串 | 随机序列(可选) |
掉落池(Pool)
| 字段 | 类型 | 可选参数 | 说明 |
|---|---|---|---|
rolls | int / object | 整数 或 | 抽取次数 |
bonus_rolls | int / object | 整数 或 | 附魔加成额外次数 |
entries | array | 条目对象数组 | 条目列表 |
conditions | array | 条件对象数组 | 条件列表 |
条目类型(Entry)
| 类型 | 可选参数 | 说明 |
|---|---|---|
item | name: str, weight: int, functions: array, conditions: array | 掉落指定物品 |
loot_table | name: str(掉落表路径) | 引用另一个掉落表 |
empty | weight: int | 空条目(什么都不掉) |
条件(Condition)
| 条件 | 可选参数 | 说明 |
|---|---|---|
killed_by_player | inverse: bool | 被玩家击杀 |
killed_by_player_or_pets | inverse: bool | 被玩家或宠物击杀 |
random_chance | chance: float(0.0~1.0) | 随机概率 |
random_chance_with_looting | chance: float, looting_multiplier: float | 随机概率(受抢夺附魔影响) |
函数(Function)
| 函数 | 可选参数 | 说明 |
|---|---|---|
set_count | count: int 或 | 设置数量 |
set_damage | damage: float 或 {min, max} (0.0~1.0) | 设置耐久损伤 |
set_data | data: int | 设置数据值 |
enchant_randomly | treasure: bool | 随机附魔 |
enchant_with_levels | levels: int 或 {min, max}, treasure: bool | 按等级附魔 |
looting_enchant | count: int 或 {min, max}, limit: int | 抢夺附魔加成 |
set_name | name: str 或 | 设置显示名 |
set_lore | lore: array(str) | 设置描述文本 |
exploration_map | destination, decoration, search_radius | 探险地图 |
set_book_contents | author, title, pages | 设置书本内容 |
fill_player_head | entity: str | 填充玩家头颅 |
specific_loot | loot: str | 特定掉落 |
set_item_from_block | — | 从方块设置物品 |
random_block_state | block_state: str, values: array | 随机方块状态 |
random_aux_value | values: array(int) | 随机附加值 |
furnace_smelt | — | 熔炉烧炼 |
set_nbt | tag: str | 设置 NBT 数据(中国版可能不支持) |
copy_name | source: str | 复制名称 |
生成规则组件
生成规则定义在 spawn_rules/ 目录下,使用 minecraft:spawn_rules 格式。
核心组件
| 组件 | 类型 | 可选参数 | 说明 |
|---|---|---|---|
minecraft:spawns_on_block_filter | object | 方块 identifier 或 array(str) | 生成在指定方块上 |
minecraft:spawns_on_block_prevented_filter | object | 方块 identifier 或 array(str) | 不在指定方块上生成 |
minecraft:spawns_above_block_filter | object | blocks: array(str), distance: int | 在指定方块上方生成 |
minecraft:spawns_underwater | object | — | 水下生成 |
minecraft:height_filter | object | min: int, max: int | 高度限制 |
minecraft:weight | object | base_weight: int, weight_range: | 生成权重 |
minecraft:herd | object | min_size: int, max_size: int, event: str, event_skip_count: int | 群体大小 |
minecraft:pack_spawn | object | max_count: int, spawn_distance: int | 打包生成 |
minecraft:biome_filter | object | test: str, operator: str, value: str | 生物群系过滤 |
minecraft:density_limit | object | surface: int, underground: int | 密度限制 |
minecraft:difficulty_filter | object | max: str, min: str | 难度过滤 |
minecraft:entity_types | object | filters: object, max_dist: float | 实体类型过滤 |
minecraft:distance_filter | object | min: int, max: int | 距离过滤 |
minecraft:is_experimental | bool | true / false | 是否实验性 |
minecraft:permute_type | array | array({weight, entity}) | 随机变体 |
minecraft:brightness_filter | object | min: int(0~15), max: int(0~15), adjust_for_weather: bool | 光照过滤 |
minecraft:delay_filter | object | min: int, max: int, identifier: str, spawn_chance: float | 延迟过滤 |
minecraft:mob_spawn_condition | object | 参见文档 | 生物生成条件 |
minecraft:world_age_filter | object | min: int | 世界年龄过滤 |
minecraft:event_filter | object | event: str | 事件过滤 |
minecraft:spawn_event | str | 事件名字符串 | 生成时触发的事件 |
minecraft:player_in_village_filter | object | distance: int, village_distance: int | 村庄玩家过滤 |
minecraft:is_persistent | bool | true / false | 是否持久存在 |
minecraft:spawn_range | object | min: int, max: int | 生成范围 |
组件速写模板
有序合成配方
json
{
"format_version": "1.20",
"minecraft:recipe_shaped": {
"description": { "identifier": "mymod:custom_sword" },
"tags": ["crafting_table"],
"pattern": ["#I#", " # ", " # "],
"key": {
"#": { "item": "mymod:ingot" },
"I": { "item": "minecraft:stick" }
},
"result": { "item": "mymod:custom_sword" }
}
}熔炉配方
json
{
"format_version": "1.20",
"minecraft:recipe_furnace": {
"description": { "identifier": "mymod:smelt_ore" },
"tags": ["furnace", "blast_furnace"],
"input": "mymod:raw_ore",
"output": "mymod:ingot"
}
}掉落表
json
{
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "item",
"name": "mymod:custom_gem",
"weight": 1,
"functions": [
{
"function": "set_count",
"count": { "min": 1, "max": 3 }
}
]
}
],
"conditions": [
{
"condition": "killed_by_player"
}
]
}
]
}