手冊:實體生成規則

出自Minecraft基岩版开发Wiki

結構概覽[編輯]

  • <behavior_pack>
    • spawn_rules

數據結構[編輯]

元件結構[編輯]

  •  minecraft:spawns_on_surface:可生成於地面
  •  minecraft:spawns_underground:可生成於地底
  •  minecraft:brightness_filter:生成亮度過濾器
    •  max:最大值
    •  min:最小值
    •  adjust_for_weather
  •  minecraft:difficulty_filter:生成難易度過濾器
    •  max:最大值
    •  min:最小值
  •  minecraft:weight:生成權重
    •  default:權重值
  •  minecraft:herd:生成實體羣居數量
    •  max:最大值
    •  min:最小值
  •  minecraft:permute_type:生成實體取代型別
      •  weight:權重
      •  weight:權重
      •  entity_type:取代實體型別
  •  minecraft:minecraft:biome_filter:生成羣系過濾器
    •  test:生成羣系規則


語法[編輯]

//复制于——原版僵尸文件(BH/spawn_rules/zombie.json)
{
    "format_version": "1.8.0",//版本号
    "minecraft:spawn_rules": {
      "description": {
        "identifier": "minecraft:zombie",
        "population_control": "monster"
      },//描述
      "conditions": [
        {
          "minecraft:spawns_on_surface": {},//地面生成
          "minecraft:spawns_underground": {},//地底生成
          "minecraft:brightness_filter": {
            "min": 0,
            "max": 7,
            "adjust_for_weather": true
          },//生成亮度过滤器
          "minecraft:difficulty_filter": {
            "min": "easy",
            "max": "hard"
          },//生成难度过滤器
          "minecraft:weight": {
            "default": 100
          },//生成权重
          "minecraft:herd": {
            "min_size": 2,
            "max_size": 4
          },//生成实体群居数量
          "minecraft:permute_type": [
            {
                  "weight": 95
            },
            {
              "weight": 5,
              "entity_type": "minecraft:zombie_villager"
            }
          ],//生成实体取代类型
          "minecraft:biome_filter": {
            "test": "has_biome_tag", "operator": "==", "value": "monster"
          }//生成群系过滤器
        }
      ]
    }
  }