Skip to content

世界与规则组件速查 ​

本页汇总配方、维度、掉落表、生成规则等"世界与规则"类内容的所有组件与字段,标注可选参数,方便快速查阅。

使用方法

  • 配方写在行为包 netease_recipes/ 目录下
  • 维度配置写在行为包根目录的 dimensions/ 下
  • 掉落表写在行为包 loot_tables/ 下
  • 生成规则写在行为包 spawn_rules/ 下

配方类型 ​

类型format_version可选参数说明详细文档
minecraft:recipe_shaped1.20pattern: array(str), key: object(字符→物品映射), result: {item, count}, tags: array(str)有序合成自定义配方
minecraft:recipe_shapeless1.20ingredients: array({item/tag}), result: {item, count}, tags: array(str)无序合成自定义配方
minecraft:recipe_furnace1.20input: str(物品identifier), output: str(物品identifier), tags: array(str)熔炉烧炼自定义配方
minecraft:recipe_brewing_mix1.20input: str, reagent: str, output: str, tags: ["brewing_stand"]混合酿造自定义配方
minecraft:recipe_brewing_container1.20input: str, reagent: str, output: str, tags: ["brewing_stand"]换容酿造自定义配方
minecraft:recipe_smithing_transform1.20template: str, base: str, addition: str, result: str, tags: ["smithing_table"]锻造转换自定义配方
minecraft:recipe_smithing_trim1.20template: 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_typeobjectoverworld / nether / the_end维度类型自定义维度
netease:generatorobjectoverworld / nether / the_end / none生成器类型自定义维度
netease:biome_sourceobject参见维度文档生物群系来源配置自定义维度
netease:light_dimint0~15光照衰减自定义维度
netease:has_ceilingbooltrue / false是否有天花板自定义维度
netease:has_skylightbooltrue / false是否有天空光照自定义维度
netease:has_weatherbooltrue / false是否有天气自定义维度
netease:coordinate_scalefloat如 1.0, 8.0(下界)坐标缩放比例自定义维度

掉落表结构 ​

顶层字段 ​

字段类型可选参数说明
poolsarray掉落池对象数组掉落池列表
random_sequencestr任意字符串随机序列(可选)

掉落池(Pool) ​

字段类型可选参数说明
rollsint / object整数 或抽取次数
bonus_rollsint / object整数 或附魔加成额外次数
entriesarray条目对象数组条目列表
conditionsarray条件对象数组条件列表

条目类型(Entry) ​

类型可选参数说明
itemname: str, weight: int, functions: array, conditions: array掉落指定物品
loot_tablename: str(掉落表路径)引用另一个掉落表
emptyweight: int空条目(什么都不掉)

条件(Condition) ​

条件可选参数说明
killed_by_playerinverse: bool被玩家击杀
killed_by_player_or_petsinverse: bool被玩家或宠物击杀
random_chancechance: float(0.0~1.0)随机概率
random_chance_with_lootingchance: float, looting_multiplier: float随机概率(受抢夺附魔影响)

函数(Function) ​

函数可选参数说明
set_countcount: int 或设置数量
set_damagedamage: float 或 {min, max} (0.0~1.0)设置耐久损伤
set_datadata: int设置数据值
enchant_randomlytreasure: bool随机附魔
enchant_with_levelslevels: int 或 {min, max}, treasure: bool按等级附魔
looting_enchantcount: int 或 {min, max}, limit: int抢夺附魔加成
set_namename: str 或设置显示名
set_lorelore: array(str)设置描述文本
exploration_mapdestination, decoration, search_radius探险地图
set_book_contentsauthor, title, pages设置书本内容
fill_player_headentity: str填充玩家头颅
specific_lootloot: str特定掉落
set_item_from_block—从方块设置物品
random_block_stateblock_state: str, values: array随机方块状态
random_aux_valuevalues: array(int)随机附加值
furnace_smelt—熔炉烧炼
set_nbttag: str设置 NBT 数据(中国版可能不支持)
copy_namesource: str复制名称

生成规则组件 ​

生成规则定义在 spawn_rules/ 目录下,使用 minecraft:spawn_rules 格式。

核心组件 ​

组件类型可选参数说明
minecraft:spawns_on_block_filterobject方块 identifier 或 array(str)生成在指定方块上
minecraft:spawns_on_block_prevented_filterobject方块 identifier 或 array(str)不在指定方块上生成
minecraft:spawns_above_block_filterobjectblocks: array(str), distance: int在指定方块上方生成
minecraft:spawns_underwaterobject—水下生成
minecraft:height_filterobjectmin: int, max: int高度限制
minecraft:weightobjectbase_weight: int, weight_range:生成权重
minecraft:herdobjectmin_size: int, max_size: int, event: str, event_skip_count: int群体大小
minecraft:pack_spawnobjectmax_count: int, spawn_distance: int打包生成
minecraft:biome_filterobjecttest: str, operator: str, value: str生物群系过滤
minecraft:density_limitobjectsurface: int, underground: int密度限制
minecraft:difficulty_filterobjectmax: str, min: str难度过滤
minecraft:entity_typesobjectfilters: object, max_dist: float实体类型过滤
minecraft:distance_filterobjectmin: int, max: int距离过滤
minecraft:is_experimentalbooltrue / false是否实验性
minecraft:permute_typearrayarray({weight, entity})随机变体
minecraft:brightness_filterobjectmin: int(0~15), max: int(0~15), adjust_for_weather: bool光照过滤
minecraft:delay_filterobjectmin: int, max: int, identifier: str, spawn_chance: float延迟过滤
minecraft:mob_spawn_conditionobject参见文档生物生成条件
minecraft:world_age_filterobjectmin: int世界年龄过滤
minecraft:event_filterobjectevent: str事件过滤
minecraft:spawn_eventstr事件名字符串生成时触发的事件
minecraft:player_in_village_filterobjectdistance: int, village_distance: int村庄玩家过滤
minecraft:is_persistentbooltrue / false是否持久存在
minecraft:spawn_rangeobjectmin: 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"
        }
      ]
    }
  ]
}