Wiki 9Minecraft Wiki 9Minecraft

Entity Spawn Rules

Configure how, where, and when custom or vanilla entities naturally generate in the world.

5Sections
3Code examples
4Known errors

Spawn rules are behavior pack JSON files that control the natural generation of entities in a Minecraft Bedrock world. You use them whenever you want a custom mob to appear organically in specific biomes, light levels, or altitudes without relying on spawn eggs, commands, or scripts. You can also use spawn rules to override and alter the natural spawning behavior of vanilla mobs.

File Structure and Description

Every spawn rule resides in the `spawn_rules/` directory of your behavior pack. The root object requires a `format_version` and a `minecraft:spawn_rules` object, which is split into two parts: `description` and `conditions`.

The `description` block links the spawn rule to an actual entity and assigns it to a population control pool. The `identifier` must exactly match the `identifier` defined in your entity's behavior file. If these do not match, the game will silently ignore the file or throw a content log error.

The `population_control` field determines which mob cap this entity counts toward. When a specific pool reaches its limit in the area around the player, no more entities sharing that pool will spawn until existing ones despawn or are killed.

BP/spawn_rules/forest_beetle.json
{
  "format_version": "1.8.0",
  "minecraft:spawn_rules": {
    "description": {
      "identifier": "custom:forest_beetle",
      "population_control": "animal"
    },
    "conditions": [
      {
        "minecraft:spawns_on_surface": {},
        "minecraft:brightness_filter": {
          "min": 7,
          "max": 15,
          "adjust_for_weather": false
        },
        "minecraft:weight": {
          "default": 10
        },
        "minecraft:herd": {
          "min_size": 2,
          "max_size": 4
        },
        "minecraft:biome_filter": {
          "test": "has_biome_tag",
          "operator": "==",
          "value": "forest"
        }
      }
    ]
  }
}

Population Control Pools

Choosing the right population control pool is critical for balancing your add-on. If you assign a common passive mob to the `monster` pool, it will take up slots meant for hostile mobs, making caves and nights noticeably safer. Conversely, putting a hostile mob in the `animal` pool may prevent cows and sheep from spawning, or cause your hostile mob to stop spawning altogether once the local passive cap is filled.

There are four valid values for `population_control`. Each pool has its own internal cap managed by the engine based on chunk ticking areas.

Pool NameWhat it doesNotes
animalCounts toward the passive land mob cap.Used for cows, pigs, sheep, and custom passive wildlife.
monsterCounts toward the hostile mob cap.Checked frequently; mobs in this pool typically despawn when far from players.
water_animalCounts toward the aquatic mob cap.Used for fish, squid, dolphins, and custom sea life.
ambientCounts toward the ambient creature cap.Primarily used for bats and non-gameplay atmospheric mobs.

Placement and Environment Conditions

The `conditions` array holds one or more objects. Each object represents a complete, independent set of rules. For an entity to spawn via a condition object, every single component inside that specific object must evaluate to true. You can add multiple condition objects to the array if you want a mob to spawn under vastly different rules depending on the context (for example, spawning rarely on the surface, but frequently underground).

To tell the game physically where to place the mob, you include placement components. `minecraft:spawns_on_surface` allows spawning on the highest solid block open to the sky, while `minecraft:spawns_underground` restricts spawns to caves and spaces beneath a solid roof. Both can be included in the same condition block if the mob should spawn regardless of sky access. For aquatic mobs, `minecraft:spawns_underwater` requires the spawn location to be a liquid block. You can also restrict spawns to specific ground materials by listing block identifiers inside a `minecraft:spawns_on_block_filter` array, or prevent them using `minecraft:spawns_on_block_prevented_filter`.

Environmental filters further narrow down valid spawn locations. `minecraft:brightness_filter` checks the light level from `0` to `15`, and includes an `adjust_for_weather` boolean that treats thunderstorms as dark enough for hostile spawns even during the day. `minecraft:height_filter` restricts spawning between a `min` and `max` Y-coordinate. Hostile mobs almost always include `minecraft:difficulty_filter`, which sets a `min` and `max` world difficulty (`peaceful`, `easy`, `normal`, or `hard`) so they do not appear in Peaceful mode.

ComponentWhat it doesNotes
minecraft:spawns_on_surfaceAllows the entity to spawn on the surface of the world.Takes an empty object `{}`.
minecraft:spawns_undergroundAllows the entity to spawn in caves and roofed areas.Takes an empty object `{}`.
minecraft:spawns_underwaterAllows the entity to spawn inside water blocks.Takes an empty object `{}`.
minecraft:brightness_filterRestricts spawning to a specific light level range.Requires `min` (0-15), `max` (0-15), and `adjust_for_weather` (boolean).
minecraft:height_filterRestricts spawning to a vertical Y-level range.Requires `min` and `max` integer values.
minecraft:difficulty_filterRestricts spawning based on world difficulty setting.Accepts `min` and `max` strings: `peaceful`, `easy`, `normal`, `hard`.

Weights, Herds, and Density

Even when all environmental conditions are met, you need to tell the engine how often to pick your mob and how many to spawn at once. The `minecraft:weight` component controls frequency. Its `default` value is an integer relative to all other mobs allowed to spawn in that same biome and pool. A weight of `100` is very common (like zombies or sheep), while a weight of `5` is quite rare (like endermen).

The `minecraft:herd` component controls pack spawning. When the game decides to spawn your entity, it will attempt to place between `min_size` and `max_size` instances of that entity in a small cluster around the chosen coordinate. You can also trigger an entity event on the first few mobs spawned in a herd using `event` and `event_skip_count`, which is useful for spawning a pack leader or baby variants.

To prevent a single mob type from dominating an area even if its weight is high, use `minecraft:density_limit`. This component takes a `surface` and/or `underground` integer cap, limiting how many of this specific entity can exist in the local area around a player before the game stops selecting it.

BP/spawn_rules/cave_stalker.json
{
  "format_version": "1.8.0",
  "minecraft:spawn_rules": {
    "description": {
      "identifier": "custom:cave_stalker",
      "population_control": "monster"
    },
    "conditions": [
      {
        "minecraft:spawns_underground": {},
        "minecraft:difficulty_filter": {
          "min": "easy",
          "max": "hard"
        },
        "minecraft:brightness_filter": {
          "min": 0,
          "max": 7,
          "adjust_for_weather": false
        },
        "minecraft:height_filter": {
          "min": -60,
          "max": 20
        },
        "minecraft:weight": {
          "default": 40
        },
        "minecraft:herd": {
          "min_size": 1,
          "max_size": 2
        },
        "minecraft:density_limit": {
          "underground": 4
        },
        "minecraft:biome_filter": {
          "test": "has_biome_tag",
          "operator": "==",
          "value": "overworld"
        }
      }
    ]
  }
}

Biome Filtering

The `minecraft:biome_filter` component dictates which biomes the condition block applies to. It uses standard Bedrock filter syntax, evaluating biome tags with `test: "has_biome_tag"`. Every vanilla biome has a collection of tags assigned to it, such as `overworld`, `nether`, `monster`, `forest`, `taiga`, `ocean`, or `cold`.

You can combine multiple filter tests using `all_of` (logical AND), `any_of` (logical OR), and `none_of` (logical NOT). For example, if you want a mob to spawn in all snowy biomes except frozen oceans, you can require the `cold` or `frozen` tag while excluding the `ocean` tag. Always include a dimension-level tag like `overworld` or `the_end` unless your biome tags are already specific enough, as forgetting a biome filter entirely or making it too broad can cause Overworld mobs to spawn in the Nether.

BP/spawn_rules/frost_boar.json
{
  "format_version": "1.8.0",
  "minecraft:spawn_rules": {
    "description": {
      "identifier": "custom:frost_boar",
      "population_control": "animal"
    },
    "conditions": [
      {
        "minecraft:spawns_on_surface": {},
        "minecraft:weight": {
          "default": 15
        },
        "minecraft:biome_filter": {
          "all_of": [
            {
              "test": "has_biome_tag",
              "operator": "==",
              "value": "overworld"
            },
            {
              "test": "has_biome_tag",
              "operator": "==",
              "value": "frozen"
            },
            {
              "test": "has_biome_tag",
              "operator": "!=",
              "value": "ocean"
            }
          ]
        }
      }
    ]
  }
}

Which versions this applies to

Applies to Minecraft Bedrock 1.8.0 and higher. Most spawn rule files continue to use format_version 1.8.0 or 1.11.0 even in modern 1.20+ packs. No experimental toggles are required for custom spawn rules.

When it does not work

What you seeWhyThe fix
Custom entity works with a spawn egg and `/summon`, but never spawns naturally in the world.The `conditions` object is missing both `minecraft:spawns_on_surface` and `minecraft:spawns_underground` (or `minecraft:spawns_underwater`). Without at least one placement component, the game has no valid vertical layer to place the mob on.Add `"minecraft:spawns_on_surface": {}` or `"minecraft:spawns_underground": {}` inside your condition object.
Content Log shows an error stating the spawn rule identifier could not be matched or fails to parse.The `identifier` in `minecraft:spawn_rules` -> `description` does not match the `identifier` in your entity's `BP/entities/*.json` file, or your entity's description has `is_spawnable` / `is_summonable` misconfigured.Ensure the namespace and name (e.g., `custom:my_mob`) are identical in both files, and verify `"is_summonable": true` is set in the entity behavior file.
Custom mobs spawn in the Nether and The End despite being designed for the Overworld.You omitted `minecraft:biome_filter`, or only used negative filters (`operator: "!="`), which evaluates to true in Nether and End biomes that lack the excluded Overworld tag.Wrap your `minecraft:biome_filter` in an `all_of` array and explicitly test for `"value": "overworld"` (or `"overworld_generation"`) alongside your other biome tags.
Passive custom mobs spawn once when entering a new chunk, then never spawn again in explored areas.The `animal` population control pool has a low cap and vanilla passive mobs do not naturally despawn. Once cows, sheep, and pigs fill the local cap, no new `animal` pool spawns can occur.Test your spawn rules in a fresh world or use `/kill @e[type=!player]` to clear the cap. If your mob is meant to cycle in and out around the player, add a despawn component to its behavior file and consider using the `monster` or `ambient` pool if appropriate.

Reference, straight from the game files

Read out of the game itself, so the ids match the version you are building for.