Mob Spawning
Mob spawning is the game placing mobs into the world at random near a player. A Monster Spawner block spawns mobs by its own rules.
The spawn cycle
The cycle runs once per tick. Every chunk within 8 chunks of a player is eligible, a 17×17 square — 289 chunks for a single player, and fewer per player where two squares overlap.
Mobs fall into three categories, each with its own population cap and its own material to stand in:
| Category | Mobs | Cap per 256 eligible chunks | Spawns in |
|---|---|---|---|
| Monster | Zombie, Skeleton, Spider, Creeper, Slime, Ghast, Pig Zombie | 70 | air |
| Creature | Sheep, Pig, Cow, Chicken, Wolf | 15 | air |
| Water creature | Squid | 5 | water |
The cap is cap × eligible chunks ÷ 256, rounded down. It scales with the
number of distinct chunk coordinates in the players' eligible areas, not the
total number of loaded chunks.
For one player, the thresholds are 79 monsters, 16 animals and 5 squid.
The population count includes every loaded mob of that category in the dimension, including mobs outside the eligible area and in lazy chunks.
That count is taken once per category per tick, before the pass over the eligible chunks, and nothing rechecks it during the pass. A tick that starts at or below the cap runs the whole pass, so a category can finish the tick well over its cap. Spawning stops while the count is above the cap.
For each eligible chunk the game draws one mob from the biome's list for that category, then picks a starting point: a random x and z inside the chunk, and a y from 0 to 127 chosen with no regard for the terrain. The chunk is abandoned unless that point is non-solid and made of the category's material, which is why most attempts end in stone.
From that point the game runs three groups of four spawn attempts. Each attempt moves up to 5 blocks in x and z from the previous one. The y never changes, so a whole group lands on one level.
An attempt needs all of:
- a full block below,
- no full block and no liquid at the spot,
- no full block above,
- no player within 24 blocks,
- 24 blocks or more from the world spawn point,
- whatever the mob itself requires.
A full block is solid, fills its whole space and is not see-through. Glass, ice, leaves, TNT, cactus, farmland, single slabs, stairs and fences are not, so no mob spawns naturally on them.
A water creature instead needs a liquid at the spot and no full block above.
Every mob a chunk produces in one tick is the same type, which is what makes packs. A chunk stops at 4 mobs, or 8 for wolves and 1 for ghasts. Each eligible chunk gets its own group of attempts in the same tick, so one pass places far more than one pack.
A spawned spider carries a skeleton rider one time in a hundred. A spawned sheep takes a random fleece colour.
Hostile mobs
A hostile mob tests light twice, and both tests are random.
The stored sky light at the spot is compared against a random number from 0 to 31, and the spawn fails if the light is larger. An enclosed spot has a sky light of 0 and always passes; a spot under open sky has 15 and fails just under half the time. That value is stored per block and does not track the time of day, so the test rejects surface spawns at midnight as often as at noon.
The current light level is then compared against a random number from 0 to 7, and the spawn fails if the light is larger. Light 0 always passes, light 7 passes one time in eight, and light 8 or brighter never passes.
During a thunderstorm the second test subtracts 10 from sky light whatever the time of day, putting an open surface at light 5 and letting hostile mobs spawn outdoors in daylight.
On Peaceful no monster spawns at all, and any zombie, skeleton, spider, creeper, giant, monster, ghast or pig zombie already in the world is removed on its next tick. Slimes are not removed.
Ghasts and pig zombies skip the light tests entirely and need only a difficulty above Peaceful and a clear space. A ghast additionally succeeds one attempt in twenty.
Slimes ignore light as well. A slime must be below y=16, in a chunk where a hash of the world seed and the chunk coordinates comes out zero — about one chunk in ten — and then succeeds one attempt in ten. The clear-space test is skipped, so a slime can appear partly inside blocks.
Passive mobs
An animal needs a Grass block directly beneath it and a light level above 8. The level used is the higher of the block's stored sky light and its block light, with no subtraction for the time of day. Torchlight therefore counts towards it. A spot under open sky reads 15 at midnight, so animals spawn at night as readily as by day.
Squid need water and a clear space, with no light condition and no depth limit. The chunk's starting point must be water, but the attempts that follow accept any liquid.
Animals spawn continuously on the same cycle as monsters. They are not placed once when a chunk generates, so an area cleared of cows fills up again.
Animals and squid spawn on every difficulty, Peaceful included.
What spawns where
Every Overworld biome shares one set of lists. The number is a weight within its own list, not a chance:
| Category | Entries |
|---|---|
| Monster | Spider 10, Zombie 10, Skeleton 10, Creeper 10, Slime 10 |
| Creature | Sheep 12, Pig 10, Chicken 10, Cow 8 |
| Water creature | Squid 10 |
Forest and Taiga add Wolf at weight 2 to the creature list. Hell, the Nether's only biome, replaces all three lists with Ghast 10 and Pig Zombie 10 as monsters. Sky carries Chicken 10 alone.
The draw only decides which mob is attempted. A slime is one monster pick in five, and almost always fails its own conditions.
The giant and the monster appear on no list and never spawn naturally.
Monster spawners
A monster spawner spawns its mob near itself while a player is within 16 blocks. The mob must meet its own conditions, such as light, but not the block tests of the spawn cycle.
Despawning
A mob more than 128 blocks from the nearest player is removed at once.
A mob older than 600 ticks has a 1 in 800 chance each tick of a second check: beyond 32 blocks from the nearest player it is removed, and within them its age resets to zero.
Both checks run only on ticks where the mob has no path to follow, plus one tick in a hundred where it does.
Slimes, ghasts and squid never age, so only the 128-block rule removes them. They check it every tick.
A hostile mob standing in light level 12 or brighter ages an extra 2 ticks per tick, reaching the 600-tick threshold three times faster.
Animals despawn on the same rules. A tamed wolf is the only mob that never despawns.
Other ways mobs appear
A thrown Egg spawns a chicken one time in eight, and four chickens in one of every 32 of those.
A pig struck by lightning becomes a pig zombie.
When every player in the world is asleep and the difficulty is above Peaceful, the game makes 20 attempts to spawn a spider, zombie or skeleton within 32 blocks horizontally and 16 vertically of a sleeper. The mob must be able to path to within 1.5 blocks of the player. If it can, it is placed in a free space beside the Bed, the player is woken, and the night does not pass.