Spawn

''This article is about natural spawning of players and mobs. For Monster Spawners see: Monster Spawner.''

Spawning refers to players and mobs being created and placed in the game world. Players will respawn on their spawn point, or at the bed they last slept in upon death.

Single Player
Every world has a "spawn point", a pair of x,z coordinates within a few hundred blocks of the origin (coordinates 0,0). By default, a player will spawn at the first suitable position above sea level at this location. If there is no such position (i.e. the column is completely full of blocks), the x and z coordinates will be perturbed by small amounts until a position is found.

Sleeping in a bed will change the player's spawn point to the location of the bed. If the bed is missing or obstructed when the player respawns, the spawn point reverts to the default location.

Multiplayer
For a precise explanation of player spawning in multiplayer, see: Spawn/Multiplayer Details.

In multiplayer, players will spawn, by default, anywhere within a 20x20 area centered at the spawn point. An individual player can change their spawn point by merely lying in a bed—they do not have to go to sleep (which can only happen if all players sleep or go AFK at the same time).

A 33x33 block area centered at the default spawn point, and spanning the full height of the map, is "protected". Players, other than server operators, cannot place or destroy blocks in the protected area, nor can they use doors or Redstone devices other than Pressure Plates. Creepers can still destroy terrain in the protected area and TNT placed outside of the protected area will destroy surrounding blocks as usual. Along with this, portals from the nether can connect to the protected area, water/lava/fire can spread from outside into the protected area, and pistons can push items inside as well. Players can place blocks on the edge of the protected area if placed against the side of a block on the outside of the area. However, if the edges of the protected area are avoided, small, indestructible structures can be built. Paintings that are put up can be removed by players in the safe zone, and sign text can be erased by destroying the sign.

Animal Spawning
Approximately one in ten newly generated chunks will contain animals, usually in packs of up to four of the same species. They will always spawn on the highest available block in a column i.e. the one that can see the sky. For an animal to spawn on it, this block must be opaque and the two blocks above it must be non-opaque. The block does not need to be Grass nor does it need to be illuminated (as it does with Mob Spawning).

Animals do not spawn in desert or ocean biomes, with the exception of squid.

Randomness for animal spawning is derived from the world seed, which means that worlds with the same seed will generate chunks with the same animals in the same places.

Very rarely, new animals can spawn in already generated chunks, just like monsters do. Unlike monsters, animals do not spontaneously despawn. As of 1.1, aggressive wolves will despawn like monsters.

Mob Spawning
Mobs are broadly divided into three categories: hostile, friendly, and water (i.e. Squid). Hostile mobs have a spawning cycle once every game tick (1/20th of a second). Friendly and water mobs have only one spawning cycle every 400 ticks. Because of this, hostile mobs can spawn at any time, but animals spawn very rarely. Instead, most animals spawn within chunks when they are generated (see Animal Spawning).

Mobs spawn naturally within a 15x15 chunk (240x240 block) area around the player. When there are multiple players, mobs can spawn within this distance of any of them. However, mobs that spawn further than 128 blocks from any player will immediately despawn (see Despawning), so the mob spawning area is effectively limited to spheres with a radius of 128 blocks, centered at each player.

Mob caps are roughly proportional to the total number of chunks eligible for spawning. To calculate the precise cap, the spawning area is expanded by one chunk in every direction, so that it is 17x17 chunks in size, and then the total number of chunks is plugged into the following formula:

cap = constant * chunks / 256

Each mob category has a separate cap and a different constant in the formula:

Hostile = 70 Passive = 15 Water = 5

In single player mode, the chunk count is 17x17 = 289, and the caps work out to:

Hostile = 79 Passive = 16 Water = 5

In multiplayer, chunks that are in range of multiple players are only counted once. So the more spread out the players are, the more chunks will be covered and the higher the caps will be.

The cap is checked once at the beginning of each spawning cycle. If the number of living mobs in a category is over its cap, the entire spawning cycle for that category is skipped.





For each spawning cycle, one attempt is made to spawn a pack of mobs in each eligible chunk. A random location in the chunk is chosen to be the center point of the pack. For the pack to spawn at all, the center block must be water for water mobs and air for all other mobs. Note that in the latter case, it must literally be an air block. Any other block, even a non-colliding one, will prevent the entire pack from spawning.

If the pack location is suitable, 12 attempts are made to spawn up to 4 mobs (8 for Wolves, 1 for Ghasts) within a 41x1x41 area centered at that block (that's a 41x41 square that is one block high). Mobs will spawn with the lowest part of their body inside this area. For each spawn attempt, a block location within the pack area is chosen at random. Though the pack area extends 21 blocks out from the center, the random location is heavily skewed toward the center of the pack. Approximately 85% of spawns will be within 5 blocks of the pack center, and 99% within 10 blocks of the center.

All mobs within a pack are the same species. The species for the entire pack is chosen randomly from those eligible to spawn at the location of the first spawn attempt in the pack:
 * In the Overworld, this depends on the biome:
 * Most biomes can spawn Sheep, Pigs, Chickens, Cows, Spiders, Zombies, Skeletons, Creepers, Endermen, Slimes (in certain chunks), and Squid.
 * Forest and taiga biomes can also spawn Wolves.
 * Jungle biome can also spawn Ocelots.
 * Ocean, river, desert, and beach biomes cannot spawn animals, only hostile mobs and Squid.
 * Mushroom biomes can spawn only Mooshrooms.
 * The Nether can spawn only Ghasts, Zombie Pigmen, and Magma Cubes.
 * Blazes spawn only in Nether Fortresses or from Monster Spawners.
 * The End can spawn only Endermen.
 * Cave Spiders spawn only from Monster Spawners, not naturally.
 * Silverfish will only spawn from the stronghold's stone, cobblestone and brick blocks and spawners.
 * The Enderdragon spawns naturally in The End, but not as part of the general mob spawning process.

Each individual spawn attempt succeeds only if all of the following conditions are met:


 * There must be no players and no player spawn points within a 24 block distance (spherical) of the spawning block


 * If it's a Squid, then...
 * the spawning block must contain liquid (water or lava)
 * the spawning block must be between level 45 and 62, inclusive
 * the spawning mob must not be obstructed by other mobs


 * If it's not a Squid, then...
 * the spawning block itself must be non-opaque and non-liquid
 * the block directly below it must be opaque
 * the block directly above it must be non-opaque
 * the spawning mob must not be obstructed by blocks, other mobs, or water


 * If it's an animal, then...
 * the block directly below the spawning block must be grass
 * the light level of the spawning block must be 9 or brighter


 * if it's an Ocelot, then...
 * the spawning block must be above level 62
 * the block directly below the spawning block must be grass or leaves
 * there is a 1/3 chance the spawn will fail


 * If it's a hostile mob in the overworld, then...
 * the light level of the spawning block must be 8 or darker, and more light increases the chance that the spawn will fail
 * sunlight falling on the spawning block further increases the chance that the spawn will fail, by up to 50%


 * If it's a Slime, then...
 * the spawning block must be in a chunk eligible to spawn slimes (see the Slime page for details)
 * the spawning block must be below level 40
 * for medium and large slimes, the difficulty must not be set to peaceful
 * there is an additional 90% chance the spawn will fail, thus slimes only spawn 1/10th as often as other mobs, all other things being equal


 * If it's a Ghast, then there is a 95% chance the spawn will fail, thus ghasts only spawn 1/20th as often as other mobs

If all of these conditions are met then the mob is spawned. The pack is complete when 4 mobs have spawned (or 8 wolves, or 1 ghast), or 12 attempts have been made, whichever comes first.

Historical Notes

 * The spawning area used to be 17x17 chunks rather than 15x15. The area was reduced, but the old size is still used to calculate mob caps.
 * It was not always possible to funnel mobs into a spawning room by preventing them from spawning elsewhere. Some older sources of information about spawning might make reference to this.
 * Large amounts of empty space used to encourage spawning in the general area. This remains true on a smaller scale, and only horizontally, due to pack spawning.
 * Before the Halloween Update, the chunk 0,0 (X 0-16 and Z 0-16) was always the first chunk evaluated for mob spawning. If one built a dark room inside that chunk, all mobs would spawn inside that room and nowhere else.

Other Types of Spawning
A Monster Spawner causes mobs to spawn constantly in the area around it.

A thrown chicken egg has a 1 in 8 chance of spawning a chicken.

Two Snow Blocks in the overworld placed on top of each other, with a Pumpkin or Jack-O-Lantern, causes a Snow Golem to spawn. Likewise, replacing the Snow Blocks with Iron Blocks (with an extra one on opposite sides of the higher block) will cause an Iron Golem to spawn. Iron Golems can also spawn in villages (though the algorithm that causes this has not yet been determined).

In Creative, the player can use Spawn Eggs to spawn most mobs.

Despawning
Monsters and squid (but not animals), including hostile wolves as of 1.1, can spontaneously cease to exist, or "despawn", under certain conditions:


 * A mob will immediately despawn if ever there is no player within 128 blocks of it. Note that this appears to be a sphere, not a cylinder from map top to bottom.
 * A mob that has had no player within 32 blocks of it for more than 30 seconds has a 1 in 800 chance of despawning on each game tick (1/20th of a second). That means that such a mob will survive for just under a minute, on average, from the time they spawned or were last within 32 blocks of a player.
 * All hostile mobs in a world will despawn if the difficulty is set to peaceful, regardless as to where the player is positioned in the world.

In multiplayer, despawning does not occur while there are no players in the game.