Natural spawning in Bedrock Edition shares only a few similarities to natural spawning in Java Edition. In Bedrock Edition, there are two main types of natural spawns: pack spawns and structure mob spawns. Structure mob spawns are mobs spawned as part of a structure, such as nether fortresses, witch huts, etc. Pack spawns account for all other types of natural spawns, including mobs that spawn individually (i.e. not in a pack of 2 or more). Both types of natural spawns follow the same rules for spawn conditions and the mob cap.
Mob spawning is evaluated for every chunk within a 6 chunk cylindrical radius of the player that is ticked; if the simulation distance is smaller than 6 chunks, then only chunks within the simulation distance will be able to spawn mobs. There is a 1 in 200 chance of the mob spawning algorithm attempting to run per chunk, per-tick.
There are two main mob caps that affect spawning: a global mob cap and a mob density cap. The global mob cap for natural spawns is set at 200 regardless of difficulty. The global mob cap only affects natural mob spawning, and does not affect mobs spawned through breeding, spawn eggs, the /summon command, monster spawners or any other type of mob spawning. Only mobs that are within ticking areas (both those around players and those set manually using the /tickingarea command) count towards the global mob cap; mobs not ticked do not count towards the global mob cap. Mobs can also have their own individual cap listed below:
- Individual Mob Caps
Mob Surface Cap Cave Cap Ghast 0 2 Creeper 5 Unlimited Other Unlimited Unlimited
Alongside the global mob cap is a mob density cap. The mob density cap limits how many mobs of each type and category can spawn within a 9x9 square region surrounding each chunk eligible for spawning. Mobs in chunks outside a ticking area count towards the mob density count. The density cap is split up into two distinct categories: a cap for surface mobs, and a cap for cave mobs. Cave mobs do not count towards the surface mob cap, and surface mobs do not count towards the cave mob cap.
There are four categories of mobs: ambient, animal, monster, and water. The mob density cap for each category and location of mob in each dimension is as follow:
- Mob Density Caps
Category Location Overworld Nether The End Ambient Surface 0 0 0 Cave 2 0 0 Animal Surface 4 0 0 Cave 0 0 0 Monster Surface 8 0 10 Cave 8 16 8 Water Surface 4 0 0 Cave 0 0 0
The following rules apply to all mobs:
- Can only spawn 24 blocks spherical radius or further from the player.
- Cannot spawn if the block below them is air.
- Cannot spawn if that mob would collide with an existing mob.
- Cannot spawn on slabs or carpet.
- Some additional rules apply to specific categories of mobs.
- For water mobs:
- Cannot spawn outside of liquid.
- For monsters:
- Cannot spawn if the light level is greater than 7.
- For non-water mobs:
- Cannot spawn on bedrock or invisible bedrock.
- Cannot spawn touching any liquid.
Pack spawning happens in two stages: first attempt to spawn surface mobs, then attempt to spawn cave mobs. Before spawning, the mob density cap is calculated based on the 9x9 square area surrounding the current chunk. Spawning begins by picking a random X and Z location within the chunk currently being evaluated. The Y coordinate is determined by starting at the world height and searching downwards for the next solid block with a non-solid block above it. The first such block that is found is considered to be the surface, and the algorithm will attempt to spawn a surface mob pack. The algorithm then continues to search downwards for the next solid block with a non-solid block above it. When a block meeting the criteria is found, the algorithm attempts to spawn a cave mob pack at that block location. Cave spawn attempts continue until the Y coordinate reaches the world bottom, and do not stop even if a cave pack was spawned.
Surface and cave pack spawn attempts then go through the following steps to figure out what mob to spawn and how many:
- Picks a random mob.
- If the current spawn location is in a liquid, pick a random water mob.
- If the light level is greater than 7, there is no other blocks above the current location, and the current location is a grass block, pick a random animal mob.
- Otherwise, spawn a monster mob.
- Picks a random number of mobs to spawn in the pack. Each mob can have its own min and max pack size, and the pack size can depend on difficulty.
- Make sure the spawn location has suitable spawn conditions.
- Limit the number of mobs spawning based on the global mob cap. If the mob count is already at or exceeds the mob cap, no mobs will spawn.
- For each mob to spawn, check that spawning it would not exceed the mob density cap.
- If would spawning the mob would not exceed the mob density cap, then the probability the mob will spawn is can be calculated using the formula: (mob density cap - current mob density count) / mob density cap
- Finally, attempt to spawn the mob in the world
- Spawning the mob can fail; for example, if spawning it would cause it to spawn inside of a block or part of a wall.
- Cows, chickens, pigs, sheep, mooshrooms, villagers, ocelots, wolves, horses, donkeys, and rabbits can breed. All of these require a player to breed them except for villagers.
- A thrown egg has a 1 in 8 chance of spawning a chicken, and an additional 1 in 32 chance of spawning 4 chickens from a single egg, so there is a total of 1 in 256 chance for a single thrown egg to spawn 4 chickens.
- A snow golem, iron golem, or wither can be made to spawn if a player builds the proper structure out of blocks. Iron golems can also spawn in sufficiently populous villages. See their respective pages for full details.
- A monster egg will spawn a silverfish if broken, or if a nearby silverfish is attacked. Zombies can spawn in large groups in villages at midnight ignoring most of the usual restrictions, forming a siege. It could even happen in mushroom biomes or if /gamerule doMobSpawning is false. The game will make 10 attempts to spawn a zombie within a 17x7x17 area centered on a block within the village's cylindrical radius, at the same Y level as the village center.
- Zombie pigmen can spawn from nether portals in the Overworld. Lighting and player proximity don't prevent this.
- Endermites can spawn randomly when a player uses an ender pearl.
- Killing medium and large slimes and magma cubes will spawn more of them, but in a smaller size.
- When a pig gets struck by lightning, it is replaced by a newly spawned zombie pigman.
- When a villager gets struck by lightning, it is replaced by a newly spawned witch.
- If a creeper gets struck by lightning, it becomes charged.
- A monster spawner causes mobs to spawn constantly in the area around it. Spawners may naturally generate spawning zombies, skeletons, spiders, cave spiders, silverfish, or blazes, but may be made to spawn other mobs using commands or spawn eggs. Mobs have the same spawning conditions they would have from a natural spawn, except hostile mobs may spawn without a block below them.
- In Creative, the player can use spawn eggs to spawn most mobs. When mobs are spawned this way, all normal spawning requirements, such as light level and block type, are ignored.
- Any entity can be spawned using the /summon command.
Entity despawning in Bedrock Edition is evaluated per-chunk, per-tick. There is a 1 in 50 chance for each chunk to attempt to despawn an entity per-tick. When despawning, a random entity in the chunk is chosen, and only despawned under the following conditions:
- The entity is more than 54 blocks circular radius away from a player.
- The light level is lower than 8.
- For monsters, light level must be greater than 8, and if it is a surface mob, it must be day time.
- The entity is too old.
- The entity does not have persistence.
In Bedrock Edition, entities with persistence do not despawn naturally. Persistence is applied to entities in the following situations:
- Interacted with by a player.
- Was ridden by the player.
- Named with a name tag.
- Tempted with food.
- Breed or born as a result of breeding.
- Was tamed.
- Tried to attack a player.
- Was attacked by the player.
- Touched the player.
- Spawned via a monster spawner.
- Spawned via a spawn egg.
- A mob spawned using the /summon command.
- Zombie Villager which was cured.
- Skeleton or Skeleton Horse which spawned as part of a skeleton trap.
- Shulker which spawned as part of an End City.
- Witch which spawned as part of a Witch Hut.
- Villager or Zombie Villager spawned as part of an Igloo.
- Zombie Villager which spawned as part of a Zombie Village.
- Vindicator which spawned as part of a Woodland Mansion.
The following entities always have persistence:
- Ender Dragon
- Wither Boss
- Elder Guardian
- Guardian
- Iron Golem
- Snow Golem
- Villager
- Armor Stand