手册:实体生成规则

来自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"
          }//生成群系过滤器
        }
      ]
    }
  }