Minecraft Wiki
Advertisement
"Respawn" redirects here. For the block to set a spawn point in the Nether, see Respawn Anchor.
This article is about the natural spawning of mobs. For other uses, see Spawn (disambiguation).
Clock JE3.gif
This article needs to be updated. 
Please update this page to reflect recent updates or newly available information.
Reason: A comprehensive check that this article is up-to-date from 1.9 to 1.18 is in order.

Spawning refers to the creation and placement of players and mobs in the Minecraft world.

Player spawning[]

World spawn[]

World spawning area. White represents the extent of singleplayer, blue represents multiplayer, and yellow represents the world spawn point.

New players initially spawn within a small area surrounding the world spawn point when the server is not in Adventure mode. This area is 21×21 blocks by default, but can be changed by the spawnRadius gamerule in both single and multiplayer. Upon death or return from the End dimension, the player respawns within this area unless the player's individual spawn point changed (by using a bed or respawn anchor, or the /spawnpoint command).

When the player first loads into the world or respawns, the game searches within the world spawn area and tries to place the player on a random grass block. Upon spawning, the player is placed on the highest valid spawn point block of the X and Z spawn coordinates, even if this would set the player above the maximum build height. However, if there are no valid spawn points but a grass block that was determined to be an invalid spawn point due to being blocked by a block above it (though the grass block would decay soon after), the game checks the closest two free spaces from below and the player spawns there. If there are absolutely no grass blocks, the player spawns directly at the world spawn point, which can even result in players spawning above the Void if there are no blocks at that location.

The world spawn point also determines the center of the permanently loaded spawn chunks.

The world spawn point itself can be changed using the /setworldspawn command.

Bedrock world spawn search[]

Clock JE3.gif
This section needs to be updated. 
Please update this section to reflect recent updates or newly available information.
Reason: Spawn search rules have changed in 1.18; more biomes are available to spawn in.

In Bedrock Edition, when a player creates a new world, the world spawn point is restricted to specific biomes. The algorithm starts searching from coordinate 0,0, continuing outward until an acceptable biome is found for the world spawn point. Using add-ons, a rare biome can be designated to cause the player to spawn at a distant location, but the game crashes if the biome does not exist or cannot generate.

The algorithm searches for these biomes:

The player spawns within a 5-block radius of the point selected in the chosen biome, sometimes resulting in the player spawning outside the intended spawn biome, ending up in a beach, river, or swamp biome. It is also possible (but rare) for a player to spawn initially underwater and start drowning.[1]

A search for a valid world spawn biome is not performed for Flat and Old world-types.

Adventure mode[]

When the server's settings specify the default game mode as Adventure (using the server.properties), then the normal spawning mechanic is ignored, and players are spawned directly on the world spawn point. This includes the X, Y, and Z coordinates, even if there is no block there, and even if there are blocks above it.

If the Y coordinate is not within a valid spawning area, then the server looks up until it finds one, up to a maximum of Y=256. If there is space to spawn, but it is in mid-air, the player spawns in mid-air, even falling into the Void if there is a hole.

Location[]

There are several ways to determine the world spawn point:

  • A compass (that hasn't been assigned to a lodestone) always points to the world spawn point.
  • Doing the commands /gamerule spawnRadius 0 then /kill.
  • If commands are disabled, remove all the grass blocks in the 21×21 spawn area (or place a block above them to make them invalid), make sure the individual spawn point is disabled, and die.
  • Entities, other than players, falling into the exit portal in the End land exactly at the world spawn point. Items thrown in mark the spot in the Overworld. Players spawn like they normally do, allowing this action to be used to perform the above without dying, and thus can be performed in hardcore mode.
  • Mods or external programs, such as NBTExplorer or MCEdit, can also be used to find and set the world spawn point.

Individual spawn[]

The individual spawn point of the player can be changed by sleeping in a bed, using a respawn anchor, or using the /setworldspawn or /spawnpoint command. If the individual spawning area of the player is obstructed upon death, the player respawns at the world spawn.

Sleeping in a bed allows for leniency in obstruction, in that the player respawns on other blocks near the bed if the original point becomes blocked. The same is true for the respawn anchor. If the spawn point set via /setworldspawn or /spawnpoint becomes obstructed, the player is not given this leniency in respawning.

Natural generation[]

Animals[]

A cow that generated with the map inside a tree's leaves and could not escape, a common sight in forested hill areas.

In Java Edition many animals generate upon initial chunk creation. These spawns occur only once per chunk. They are not affected by the /gamerule doMobSpawning command.

One in ten newly-generated chunks attempts to generate animal mobs, usually in packs of up to 4 of the same species. The spawn attempt always starts on top of the highest available block in a randomly chosen column within the chunk. The chosen position must not be a solid block for the animals to generate. Once the starting position is chosen for a chunk, a second position is chosen in a 9×9 block area around the starting position. Blocks toward the center of the 9x9 area are more likely to be chosen than blocks toward the edge. The block does not need to be a grass block nor does it need to be illuminated as it does with mob spawning. If an animal can spawn at the second position, it does so. The second position becomes the first position, and a new second position is chosen like before in a 9x9 area. This process can repeat until each chunk has attempted to spawn 1–4 mobs.

In Bedrock Edition animals do not spawn during chunk generation, but they continually attempt to spawn everywhere as part of the environmental spawning algorithm, according to their spawn weights, biome tags, and block requirements (see Bedrock Edition under Spawn Cycle, below).

There are 2 types of animals: common animals and biome-specific animals.

Common animals

Common animal mobs do not spawn in desert, badlands, beach, snowy plains, river, ocean, or mushroom fields biomes.

Mobs Weight Group size
Sheep 6 4
Chicken 5 4
Pig 5 4
Cow 4 4


Biome-specific animals

Some animal mobs spawn only in specific biomes.[more information needed]

Mobs Biome Weight
Axolotl Lush Caves 4
Cod Ocean
Lukewarm Ocean
Cold Ocean
Frozen Ocean
75
Dolphin Ocean
Warm Ocean
Lukewarm Ocean
Cold Ocean
7
Donkey Plains 1
Fox Taiga
Snowy Taiga

Old Growth Pine Taiga

8
Glow Squid Ocean[more information needed] 2-4
Goat Frozen Peaks
Jagged Peaks
Snowy Slopes
3
Hoglin[BE only] Crimson Forest 20
Horse Savanna
Plains
4 in plains

1 in savanna

Llama Savanna
Windswept Hills
8 in savanna

5 in windswept hills

Mooshroom Mushroom Fields 8
Ocelot
Parrot
Jungle
Bamboo Jungle
30 for ocelots
40 for parrots
Panda Jungle
Bamboo Jungle
10 in regular jungle

40 in bamboo jungle

Polar Bear Snowy Plains

Frozen Ocean
Frozen River

1 (5 in Frozen Oceans)
Pufferfish
Tropical Fish
Warm Ocean
Lukewarm Ocean
Deep Lukewarm Ocean
25 for pufferfish
75 for tropical fish
Rabbit Desert
Taiga

Old Growth Pine Taiga
Snowy Taiga
Snowy Plains
Frozen Ocean
Frozen River
Snowy Beach
Legacy Frozen Ocean
Flower Forest

4 (20 in flower forests)
Salmon River
Cold Ocean
Frozen Ocean
Lukewarm Ocean
26 in oceans

16 in rivers

Squid Ocean
River
8
Strider Nether Wastes
Crimson Forest
Soul Sand Valley
Basalt Deltas
Warped Forest
20
Turtle Beach 8
Wolf Taiga (all variants)
Forest (all variants)

Windswept Hills (all variants)

8 in taigas

5 in forests and windswept hills

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

Monsters[]

Monsters cannot spawn when the difficulty is set to Peaceful (except piglin‌[BE only] and hoglin). At any higher setting they spawn when block light level is 0. The player cannot sleep when a monster (other than hoglin; and in Java Edition, also include slime, magma cube and non-hostile zombified piglin) is nearby, even if the monster has no path to the player.

Common monsters

Common monster mobs can spawn in almost any biome in the Overworld (except for mushroom fields). They can spawn on the surface and underground. The weight determines the spawn rate in the Bedrock Codebase.

Mobs Weight Group size
Zombie 100 2-4
Creeper 100 Individually
Skeleton 80 1-3
Spider 100 Individually
Enderman 10 1-4
Witch 5 Individually
Spider Jockey 1 Individually
Chicken Jockey 0.25 Individually
Biome-specific monsters

Some monsters spawn only in specific biomes.

Mobs Biome
Drowned Ocean (all variants)

River (all variants)
Dripstone Caves

Ghast Nether Wastes

Soul Sand Valley
Basalt Deltas

Hoglin[JE only] Crimson Forest
Husk Desert (all variants)
Magma Cube Nether Wastes

Basalt Deltas

Slime Swamp
Stray Snowy Plains

Ice Spikes
Frozen River
Frozen Ocean (all variants)

Piglin
Zombified Piglin
Zombified Chicken Jockey
Nether Wastes

Crimson Forest

Other mobs[]

In Java Edition these mobs still spawn if the /gamerule doMobSpawning command is set to false, because they spawn as part of structure generation. In Bedrock Edition nothing spawns if the /gamerule doMobSpawning command is set to false.

Animal mobs
Mob Structure generation
Black Cat A single cat spawn within or around a Swamp Hut upon generation.
Cat
Cow
Horse
Pig
Sheep
Generate as part of the Village generation.
Specific animals spawn as part of specific village structures: Animal pens (cow, sheep, pig, or horse), stables (horse, cow, or pig), butcher's houses (pig, cow, or sheep), and shepherd's houses (sheep).
Monster mobs
Mob Structure generation
Drowned Generate as part of some underwater ruins.‌[JE only]
Elder Guardian
Guardian
Generate as part of a single Ocean Monument.
Ender Dragon Created in The End when the dimension is created. The ender dragon can also be respawned by placing end crystals on the exit portal.
Evoker
Vindicator
Generate as part of woodland mansion.
Pillager Spawn from pillager outposts.
Shulker Generate as part of end cities.
Witch A single witch spawn within a Swamp Hut upon generation.
Zombie Villager Generate as a part of an igloo if it generates with a basement.
Can spawn as part of zombie village generation, where they never despawn naturally.
Other mobs
Mob Structure generation
Iron Golem Spawn from pillager outposts.
Iron Golem
Villager
Generate as part of the village generation.
Each villager spawns in a house with a bed, and an iron golem spawns as part of meeting points.
Villager Generate as a part of an igloo if it generates with a basement.
Can spawn as part of zombie village generation, where they never despawn naturally.

Spawn cycle[]

Java Edition[]

Mobs are broadly divided into seven categories: hostile, friendly, water creature (squids and dolphins), underground water creature (glow squids), axolotls, water ambient (all 4 types of fish), and ambient (bat). Hostile and water mobs have a spawning cycle once every game tick (120 of a second). Friendly mobs have only one spawning cycle every 400 game ticks (20 seconds). Because of this, where conditions permit, hostile mobs spawn frequently, but passive mobs (animals) spawn rarely. Most animals spawn within chunks when they are generated.

Mobs spawn naturally within a square group of chunks centered on the player, 15×15 chunks (240×240 blocks). When there are multiple players, mobs can spawn within the given distance of any of them. However, hostile mobs (and some others) that move farther than 128 blocks from the nearest player despawn instantly, so the mob spawning area is more-or-less limited to spheres with a radius of 128 blocks, centered at each player. In multiplayer, mob caps are shared by all players, no matter where they are.

Every 24000 game ticks (20 minutes) the game attempts to spawn a single wandering trader with two leashed llamas within 48 blocks of a player or at a village meeting place, if no wandering trader exists in all loaded chunks. The trader does not spawn when the player is underground.‌‌[Java Edition only]

Java Edition mob cap[]

Jigsaw Block (top texture) JE2 BE2.png
This section needs expansion. 
You can help by expanding it.
Instructions: The new charge/cost/energy system used for Soul Sand Valleys and Warped Forests. Each mob has a cost for spawning and deducts it from the biome's total energy. Is it reduced per entity spawn or per pack spawn? How does energy recharge? Etc. See Biome.java, NaturalSpawner.java, and PotentialCalculator.java.

Mob caps are directly proportional to the total number of chunks eligible for spawning. To calculate the cap, the spawning area is expanded by one chunk in every direction (so the default gives 17×17 chunks), then the total number of chunks is plugged into the following formula:

mobCap = constant × chunks ÷ 289

The constants for each group are as follows:

  • Monster = 70
  • Creature = 10
  • Ambient (bats) = 15
  • Axolotls = 5
  • Underground water creature (glow squids) = 5
  • Water creature (squids, dolphins) = 5
  • Water ambient (fish) = 20
  • Misc = -1

The "misc" category is used only by entities that are not mobs, do not spawn naturally, and/or following different spawning rules than other mobs. As such the mob cap has no bearing on mobs of this category.

In singleplayer, there are always 289 chunks in range, so the constant is always used as the global mobcap.

In multiplayer, the global mob cap grows as more chunks are loaded. Because chunks that are in the range of multiple players are counted once, more chunks and higher mob caps result from the players spreading out.

The number of mobs is checked once per each chunk against the cap. If the number of mobs (dead or alive) in a category is at its cap, the entire spawning cycle for that category is skipped. The area checked for mobs is the same as the area used for calculating the mobcap, which is the spawning area expanded by one chunk in every direction. The mobcap count is separate for each dimension.

Every chunk, the game checks the mobcap. As such, you can reach mobcap+pack size from natural spawns.

When /gamerule spectatorsgeneratechunks is set to false, spectators do not raise mobcap.

Pack spawning[]

Example of a mob pack spawning. The 41×1×41 spawning area is shaded blue (not to scale). The yellow figures represent the actual positions that mobs could spawn in after checking the environment. Note that the mobs can spawn inside torch and ladder blocks. But they can't spawn on top of glass because it is not opaque. The red cube is the center of the pack.

Requirements for the spawning location of individual mobs.

For each spawning cycle, attempts are made to spawn packs of mobs per each eligible chunk. An eligible chunk is determined by the same check for which chunks are random ticked. A random location in the chunk is chosen to be the center point of the pack. If the block in which a pack spawn occurs is an opaque full cube, further pack spawn attempts are canceled. There are a maximum of 3 pack spawn attempts per mob category.

The pack is spawned within a 41×1×41 (that's a 41×41 square that is one block high) area centered at the initial block. Mobs spawn with the lowest part of their body inside this area. For each spawn attempt, from the location of the previous attempt, a location up to 4 blocks away from the previous attempt is chosen at random. Thus, the spawns are heavily skewed toward the center of the pack. Approximately 85% of spawns are within 5 blocks of the pack center, and 99% within 10 blocks of the center. If the pack spawn enters a biome different from the starting biome, the rest of the pack and that spawn are canceled.

All mobs within a pack are the same species. The species for the entire pack is chosen randomly, but based on a weight system from those eligible to spawn at the location of the first spawn attempt in the pack.

The game checks on each spawn if the number of mobs that have been spawned for the pack is equal to the max spawn attempts, as well as the location's spawn potential.

Pack spawn size

Pack spawn attempts max out at:

  • 8 Wolves, cod, and tropical fish
  • 6 Horses and Donkeys
  • 1 Ghast
  • 4 for any other mob

When the max pack size is less than the number of possible spawn attempts, some spawns attempts fail, but are seen more commonly in practice. Based on the number of mobs that have been successfully spawned. If the max pack size is greater than the number of spawn attempts, one gets only the number of spawns from the spawn attempts. Some mobs have a minimum and max pack size, meaning there is an even chance for any number of spawn attempts between them occurring.

Pack spawn location

For all dimensions, structure-based spawns take priority over biome for hostile spawns. This means that in a swamp hut, pillager outpost, nether fortress (outer bounding box only when there is nether bricks below it‌[JE only]), and ocean monument, one sees only the corresponding hostile mobs for that structure within that structure.

In the Overworld, this depends on the location:

In the Nether:

Spawn conditions[]

Whether a spawn condition fails differs from the above determination if the game tries to spawn them in that biome. For example, dolphins can have pack spawns that occur inside of frozen ocean and deep frozen ocean biomes, but no other biomes. These rules apply to variants of the same mob, such as baby zombies and spider jockeys.

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

  • There must be no players or the world spawn point within a 24 radius block distance (spherical) of the spawning block
  • The number of loaded mobs of that type must be less than the mob cap for that type. (I.e. the corresponding mobcap must not be full)
  • The mob's collision box upon spawning must not collide with another collision box. A mob cannot spawn inside of anything that would collide with it upon spawning.
  • The mob's collision box must not intersect with a solid block.
  • For all mob types excluding passives and fish, spawns fail unless within a 128 radius block sphere around the player. For fish, spawns fail unless within a 64 block radius of the player. [2]
  • /gamerule doMobSpawning is true
  • For non-aquatic mobs, the spawning block and the block above that cannot be rails, powered rails, detector rails, activator rails, redstone components, wither roses (except for wither skeletons) or sweet berry bushes (except for foxes).
Hostile mobs
  • The difficulty must not be Peaceful, excluding piglins and hoglins
  • This also affects ocelots[3]
  • For all hostiles other than guardians, drowned, and phantoms:
    • the block directly below it must have a solid, opaque, top surface (this includes upside down slabs, upside down stairs, and others) or be soul sand or a slime block.
    • the block directly below it must not be bedrock, barrier, or‌ any type of trapdoor‌ or glass.
    • The mob's collision box must not collide with any liquid.
    • The block above the spawning block must be transparent
  • For slimes from swamp biomes, creepers, skeletons, wither skeletons, witches, zombie villagers, husks, strays, drowned and spiders:
    • The light level divided by 8 is the chance of a spawn failing; thus mobs spawn at light level 7 and below.
    • Spawns with sky access in the Overworld have an additional 50% failure rate when the light level is 15.
    • If it is a slime from a swamp biome, then.....
      • the spawning block must be in a swamp biome
      • the spawning block be on level 51 through 69 inclusive
      • chance of failure based on the phase of the moon
      • with a 50% chance of failure.
    • If it is a husk or stray, then....
      • The location of the spawn must have sky access.
    • If it is a skeleton in a Nether fortress, then...
    • The light checks in the general hostile mob check don't apply to:
      • Slimes from slime chunks (see the slime page for details), which spawn when:
        • the spawning block is below level 40.
        • with a 90% chance of failure.
      • If it is a ghast, then...
        • With a 95% chance of spawn failure.
      • If it is a magma cube or hoglin, then...
        • the block below must not be a nether wart block.
      • If it is a blaze, then...
        • the light level must be 11 or darker.
      • If it is a piglin or zombified piglin, then...
        • the light level must be 11 or darker.
        • the block below must not be a nether wart block
      • If it is a blaze, wither skeleton, skeleton, magma cube or zombified piglin in the fortress external bounding box:
        • the block beneath must be nether bricks.
      • If it is an ocelot, then....
        • Spawn has a 13 chance of failure.
        • the spawning block must be level 63 or higher.
        • the block directly below the spawning block must either be grass block or leaves.
  • For guardians and drowned:
    • The spawning block and the block below must be water, including waterlogged blocks and bubble columns.
      • If it is a guardian, then...
        • 95% chance of failure if the spawning block has sky exposure (details).
      • If it is a drowned:
        • It has a 140 chance to succeed in oceans, while a 115 chance to succeed in rivers.
        • In ocean biomes, drowned spawn at a height less than 5 blocks below sea level.
Passive mobs
  • The mob's collision box must not collide with any liquid.
    • if it is not a strider, the light level of the spawning block must be 9 or brighter.
    • If it is a strider, then.....
      • Spawn attempts with lava above check upward as long as there is still lava for if they can successfully spawn in a lava block with air on top.
      • The spawning block must be at level 31 or lower.
Aquatic mobs
  • The spawning block must be water
    • For cod, salmon, pufferfish, tropical fish, squid or dolphin:
      • the block directly below the spawning block must be water
      • the block directly above the spawning block must be water and cannot be waterlogged
      • the spawning block must be between level 50 and 63, inclusive. This does not apply to tropical fish spawning in lush caves
    • If it is a glow squid, then...
      • the light level must be 0
      • the spawning block must be level 30 or lower
    • If it is an axolotl, then...
      • the block directly above the spawning block must not be a solid block
      • the block directly below the spawning block must be clay
Ambient mobs
  • The mob's collision box must not collide with any liquid.
    • If it is a bat, then...
      • the spawning block must be at level 62 or below.
      • the block directly below it must have a solid, opaque, top surface.
      • the block directly below it must not be bedrock, barrier, or‌ any type of trapdoor‌ or glass.
      • If the real-time day is between October 20 and November 3, then the light level must be 7 or darker. Otherwise, the light level must be 4 or darker.

If all of these conditions are met then the mob is spawned.

Spawn costs

Locations that do not have spawning potential reliant spawns are marked by wart blocks or netherrack

The warped forest and soul sand valley biomes introduced a new mechanic to limit the amount of mobs that naturally spawn in them. The spawn cost (also called spawn potential or spawn density) takes on a value for each block in the biome. Certain mobs increase that value by some number divided by their distance to the block. If a new spawn attempt would bring the spawn cost of the spawning block above a certain threshold, the spawn attempt is canceled. This results in mobs not spawning too close to one another in these biomes, and new spawns in the area are completely blocked long before the full mobcap of 70 hostile mobs is ever reached.

Which mobs add to the spawn cost, how much they add and what the maximum value is are all biome-specific. In soul sand valleys, skeletons, ghasts, striders and endermen all add 0.15 (divided by distance), and the maximum value allowed is 0.7. In warped forests only endermen affect the cost. There they add 0.12 each, and the maximum cost is 1.0.

Due to the limited total number of mobs in soul sand valleys and warped forests, a larger-than-usual amount of mobs spawn in any space outside of these biomes, including in Nether fortresses.

Notes
  • Buildings surrounded by air spawn more mobs inside than underground rooms because packs that spawn outside of the building can spawn mobs inside it. The mob caps tend to be reached in seconds.
  • If the player's view distance or the server view distance in multiplayer is at 9 or below, mob spawning is severely reduced (or they despawn too quickly), and may result in the player encountering no mobs at all. Set the view distance to 10 or higher to ensure mobs spawn correctly.

Bedrock Edition[]

Environmental spawning in Bedrock Edition shares broad similarities to natural spawning in Java Edition: mobs spawn in a radius around the player subject to block conditions, lighting conditions, biome conditions, naturally generated structure conditions, and caps. Many mobs spawn in groups (called "packs" in Java and "herds" in Bedrock). One notable difference from Java Edition is that most animals can spawn at light level 7 or higher rather than 9 or higher.

There are two types of environmental spawns: cluster spawns and structure spawns. Structure spawns reproduce specific types of mobs at specific locations within certain naturally generated structures, such as nether fortresses, swamp huts, etc. Cluster spawns account for all other types of environmental spawns, including mobs that spawn individually (i.e. not in a herd of 2 or more). Both types of environmental spawns follow the same rules for spawn conditions and mob caps, except that structure spawns can exceed the monster population cap by 1 (see below).

Mob spawning in bedrock edition happens within a spherical shell 24-44 blocks away from the player on simulation distance 4. It happens a quasi-spherical shell 24-128 blocks away from the player, restricted by a simulation distance and/or to roughly 96 blocks horizontally, on simulation distances 6 and higher. This means that mobs can spawn directly above or below the player (for example, phantoms in the sky or zombies underground). Mobs can spawn only in chunks that are being ticked. There is a 112000 chance of the mob spawning algorithm attempting to run per chunk, per tick.

Bedrock Edition mob cap[]

There are three mob caps that affect environmental spawning: a global mob cap, population control caps for general mob types, and density caps for specific mob types. The global mob cap is set at 200 regardless of difficulty. The global mob cap affects only environmental mob spawning, and does not affect mobs spawned through breeding, spawn eggs, the /summon command, spawners, or any other type of mob spawning. Chickens created by thrown or dispensed eggs are counted in the global mob cap. Only mobs that have spawn rules count toward the global cap (i.e. armor stands and minecarts do not take up cap space). In addition, mobs that are within ticking areas (both those around players and those set manually using the /tickingarea command) count toward the global mob cap; mobs not ticked do not count toward the global mob cap.

The population control caps limit how many mobs of each type and category can spawn within a 9 chunk by 9 chunk square region surrounding the chunk in which the spawn attempt is made. Mobs in chunks outside a ticking area still count toward population control counts as long as they were previously loaded (i.e. within simulation distance at some time) after relogging. The population control caps are split up into two distinct categories: a cap for surface mobs, and a cap for cave mobs. Cave mobs do not count toward the surface mob cap, and surface mobs do not count toward the cave mob cap. Whether a mob counts as a surface mob or a cave mob is determined by where or how it spawned, not where it happens to be at the moment. For cluster spawns, those that spawn on the highest spawnable block at a given coordinate count toward the surface cap, and any that spawn below the highest solid or non-solid but spawnable (e.g. ice or upper slab with air above) block count toward the cave cap. Structure-spawned mobs and converted mobs (i.e. drowned converted from zombies, witches from villagers, zombified piglins from pigs, and medium and small slimes from killed larger slimes) always count toward the cave cap, and spawner-spawned mobs always count toward the surface cap.

There are five categories of mobs: ambient, animal, monster, pillager, and water_animal. The population control cap for each category and location of mob in each dimension is as follows (* denotes values that are coded in the game but not actually used by any mobs):

Population control caps
Category Location Overworld Nether The End
Ambient Surface 0 0 0
Cave 2 0 2*
Animal Surface 4 0 4*
Cave 0 4 0
Monster Surface 8 0 10
Cave 8 16 8*
Pillager Surface 8 0 8*
Cave 8 0 8*
Water_Animal Surface 36 0 36*
Cave 0 0 0

Some specific mobs types also have their own density caps. The density caps limit the number of those mobs to some amount below the applicable population control cap. Density caps are checked in the same manner as the population control caps. Caps are below (n/a indicates that the mob does not spawn in that environment at all).

Mob Density Caps
Mob Surface cap Cave cap
Cod 20 n/a
Creeper 5 unlimited (population control cap still applies)
Dolphin 5 n/a
Drowned 5 in ocean
2 in river
n/a
Ghast n/a 2
Phantom 5 n/a
Pufferfish 3 n/a
Salmon 10 in ocean

4 in river

n/a
Squid 4 in ocean

2 in river

n/a
Tropical Fish 20 for preset pattern
20 for random pattern
n/a

Bedrock spawn conditions[]

The following rules apply to most mobs:

  • Mobs spawn at a distance from the player that depends on the world's simulation distance:
    • Simulation distance 4: between 24 and 44 blocks spherical radius from the player.
    • Simulation distance 6 and up: between 24 and 128 blocks spherical radius from the player, but limited horizontally by simulation distance and coding that restricts the spawning algorithm from running in chunks whose center exceeds 96 blocks from the player.[5]
  • The bottom part of the mob (i.e. the feet of a standing mob, or the whole body of a mob <= 1 block tall) can spawn only in an air block, or for water mobs in a water block. A few naturally-generated, non-motion-blocking blocks such as grass and flowers are ignored for this rule.
  • There must be a block with a full, solid top surface under the spawn location for the mob to spawn on. (I.e. mobs cannot spawn on carpets, lower slabs, fences, right-side-up stairs, redstone repeaters, chests, etc.)
  • Mobs cannot spawn on transparent full blocks like glass and leaves.
  • For mobs that can spawn floating in water or flying in air, the block that is checked for spawning is the water or air block immediately above the first solid top surface block below the spot where the mob would spawn. (So for example, phantoms cannot spawn over a field covered in carpet, and fish cannot spawn in an ocean where bottom slabs cover the ocean floor.)
  • Most overworld monsters cannot spawn if the sky light level is greater than or equal to 7 or the block light level is greater than 0.
  • Most overworld animals cannot spawn if the (combined) light level is less than 7.

Cluster spawning[]

Cluster spawning happens in two stages: first attempt to spawn surface mobs, then attempt to spawn cave mobs. Before spawning, the population control cap is calculated based on the 9 chunk x 9 chunk 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 downward for a solid-top-surface block with a non-spawn-blocking block above it. The first such block that is found is considered to be the surface, and the algorithm attempts to spawn a surface mob herd. However, if the algorithm finds a solid block before finding a spawnable solid-top-block (e.g. if it finds a tree trunk directly under leaves), it does not make any surface spawn attempt. The algorithm then continues to search downward for the next suitable block with a non-spawn-blocking block above it. When a block meeting the criteria is found, the algorithm attempts to spawn a cave mob herd at that block location. Cave spawn attempts continue until the Y coordinate reaches the world bottom, and do not stop even if a cave herd was spawned.

Surface and cave cluster spawn attempts then go through the following steps to figure out what mob to spawn and how many:

  1. Picks a random mob.
    • If the current spawn location is in a liquid, pick a random water mob.
    • If the light level is 7 or higher, there are 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.
  2. Picks a random number of mobs to spawn in the herd. Each mob can have its own min and max herd size, and the herd size can depend on difficulty and biome.
  3. Make sure the spawn location has suitable spawn conditions.
  4. Limit the number of mobs spawning based on the global mob cap. No mobs spawn if the mob count already meets or exceeds the mob cap.
  5. For each mob to spawn, check that spawning it would not exceed the population control cap or mob density cap.
    • If spawning the mob would not exceed the population control or mob density caps, then the probability of a mob spawning can be calculated using the formula: (mob density cap - current mob density count) / mob density cap
  6. 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.

Structure spawning[]

Structure spawn attempts occur at specific relative X and Z coordinates in naturally generated structures, known as "hard-coded spawn spots". The structures that have hard-coded spawn spots include swamp huts, ocean monuments, pillager outposts, and nether fortresses. Whenever a successful cluster spawn attempt occurs within a chunk that contains a hard-coded spawn spot, the environmental spawning algorithm also attempts a structure spawn. (Note that a "successful attempt" here means that a spawnable block was found, even if the spawn was then blocked by light level check or mob cap check.) The structure spawn attempt follows the same rules and steps described above for cluster spawning, with the following changes:

  • Instead of starting at world height and searching down to bedrock at the specific X and Z location, the search begins and ends at a specific Y values determined by the type of structure. Structure spawn attempts occur only on the first spawnable block found (i.e. the highest spawnable block) within that range.
  • The mob picked depends on the structure: swamp huts spawn witches, ocean monuments spawn guardians, pillager outposts spawn pillagers (including patrol captains), and nether fortresses spawn skeletons, wither skeletons, blazes, and magma cubes.
  • The population control caps are effectively 1 higher for structure spawn attempts.

Other types of spawning[]

General[]

  • In Creative or via a dispenser, 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 (though monsters other than vindicators‌[BE only], evokers‌[BE only], shulkers, and ender dragon still cannot be spawned in peaceful).
  • Any entity can be spawned using the /summon command.

Animals[]

Mob Spawning
Axolotl
Cod
Salmon
Pufferfish
Tropical Fish
Spawn when using the corresponding bucket of aquatic mob.
Bee Spawn when a bee nest or beehive is broken without Silk Touch.
Brown Mooshroom Spawns when a red mooshroom is struck by lightning, and vice-versa.
Chicken A thrown egg spawns baby chickens.
Turtle Turtle eggs hatch and spawn baby turtles.

Monsters[]

Mob Spawning
Blaze
Cave Spider
Magma Cube
Silverfish
Skeleton
Spider
Zombie
A monster spawner causes mobs to spawn constantly in the area around it.
Charged Creeper If a creeper gets struck by lightning, it becomes charged.
Endermite Can spawn randomly when a player uses an ender pearl.
Evoker
Pillager
Ravager
Vindicator
Witch
Can spawn as part of raids or patrols.
Silverfish An infested block spawns a silverfish if broken, or if a nearby silverfish is attacked.
Skeleton Skeletons spawn as 20% of naturally-spawning strays.
Skeleton Horse Can spawn during thunderstorms, cause Skeleton Horseman spawns.
Slime Killing medium and large slimes and magma cubes spawn more of them, but in a smaller size.
Phantom Can spawn after player does not sleep or die for at least 3 days. (In Bedrock Edition phantoms are spawned by the environmental spawning algorithm like other monsters. They are subject to the monster cap, and they count toward the monster cap).
Witch When a villager gets struck by lightning, it is replaced by a newly spawned witch.
Wither Can be made to spawn if a player builds the proper structure out of blocks.
Zombie Zombies spawn as 20% of naturally-spawning husks.‌[JE only]
Zombie
Zombified Piglin
Illager
Can spawn reinforcement when hurt‌[JE only].
Zombie Villager Zombie villagers spawn as 5% of naturally-spawning zombies.
A villager killed by a zombie has a 50% chance of becoming a zombie villager in normal difficulty, and 100% chance in hard difficulty.
Zombified Piglin Can spawn from nether portals in the Overworld. Lighting and player proximity don't prevent this.
When a pig gets struck by lightning, it is replaced by a newly spawned zombified piglin.
Zoglin
Zombified Piglin
If a piglin or hoglin is transported to the Overworld or the End, after 15 seconds they transform into zombified piglins or zoglins, respectively.

Other mobs[]

Mob Spawning
Agent An agent spawns when using a code connection.‌[Bedrock and Education editions only]
Iron Golem
Snow Golem
Can be made to spawn if a player builds the proper structure out of blocks. They can also be created by an enderman.

Despawning[]

Java Edition[]

Various mob spawning ranges, illustrated.

All monster, ambient, and aquatic mobs excluding shulkers, withers, elder guardians and ender dragons despawn unless they have been marked persistent. Other mobs that are not monster, ambient, or aquatic that do despawn include ocelots, stray cats, and wandering traders.

  • A mob that has had no player within 32 blocks of it for more than 30 seconds, or 10 seconds if in low light levels, has a 1800 chance of despawning on each game tick (120 of a second), which is a 2.47% chance per second. Therefore, the mob population declines so that half remains after 27.75 seconds, and the average lifetime of monsters not within 32 blocks of a player is 40 seconds (after the initial 30 seconds have elapsed).
  • Mobs other than fish despawn immediately if no player is within 128 blocks of it, while fish despawn if no player is within 64 blocks.[6]
    • This is a Euclidean sphere, not a cylinder from map top to bottom and not a taxicab sphere (an octahedron). Example: A mob at 0/y/0 remains at least 10 seconds (as above) if the player moves to 65/y/65 (real distance 91.9), but despawns immediately if the player moves to 91/y/91 (real distance 128.7).
    • The chunk the mob is in must still be loaded for the mob to despawn. Otherwise, the mob is saved until the chunk is loaded again. For example, if a player enters a nether portal while being chased by a spider, the spider is saved, and it resumes chasing the player coming back through the same portal. In the case of a player reloading chunks, the loading happens before the player is added, meaning they may despawn.
  • Ocelots and most monster mobs (including those that are holding items) despawn if the difficulty is set to Peaceful, regardless of where the player is located. Monster mobs that do not despawn include hoglins, piglins, and shulkers in all editions, as well as vindicators, zoglins, piglin brutes, and evokers in Bedrock Edition.
  • For despawning to occur, there must be at least one non-spectator player in the dimension.
  • Chickens that originally spawned as chicken jockeys follow zombie despawn rules, rather than chicken despawn rules.
  • Wandering traders and trader llamas despawn after 40-60 minutes (2-3 in game days). They also despawn sooner if all the trades are locked.
  • Endermites despawn after 2 minutes unless named with a name tag or have persistent tag.

Mobs are persistent, meaning they do not despawn and do not count toward the mob cap, when they:

  • are a passenger to another mob.
  • are riding a boat or a minecart.[7]
  • spawned as part of a generated structure.
  • have had something added to their inventory, including having something dispensed upon them (such as a saddle) or something they have picked up, but never for anything they spawn with. This includes dolphins playing with items[verify].
  • have been named with a name tag. However, one created from a renamed spawn egg does despawn as normal.
  • have had the NBT tag {PersistenceRequired: 1b} set on them, whether by being summoned with it, or by being set manually with /data merge or /data modify[JE only]. This is also the only way to prevent wandering traders from despawning.

Following mobs also have another way to prevent despawning and do not count toward mob cap:

Bedrock Edition[]

In Bedrock Edition, like Java, despawning occurs based on distance and chance.

  • On simulation distances 6 and higher, almost all environmentally spawned mobs immediately despawn when they are either (1) in a chunk at the edge of the simulation distance (technically, a chunk not fully surrounded by 8 chunks that were simulated on the last game tick), or (2) more than 128 blocks from the nearest player.
  • On simulation distance 4, mobs immediately despawn when they are more than 44 blocks from the nearest player.
  • Fish despawn at a shorter distance, when they are more than 40 blocks from the nearest player on all simulation distances.
  • Mobs more than 32 blocks from the nearest player have a 1 in 800 chance to despawn on each game tick if they have not taken damage for 30 seconds.

Mobs with persistence do not despawn. Mobs gain persistence in the following ways:


The following entities always have persistence:

History[]

This section is missing information about Bedrock Edition. 
Please expand the section to include this information. Further details may exist on the talk page.
Java Edition Classic
August 25, 2009Mobs shown to spawn in groups.
Java Edition Indev
0.3120100204-2Mob spawning is now determined by light level. Hostile mobs spawn only in dark areas, and passive mobs spawn only in bright areas.
Java Edition Infdev
20100327The player now drops their inventory and respawns at the spawn location upon death, rather than having to reload the last save.
Java Edition Alpha
v1.2.0?The mob spawning algorithm has been changed. Trying to spawn mobs inside a solid block no longer causes that entire spawn cycle to bail out.
The chunk 0,0 (X 0-15 and Z 0-15) is no longer always the first chunk evaluated for mob spawning. Previously, if one built a dark room inside that chunk, almost all mobs would spawn there as there was no chance of the algorithm bailing out before reaching that chunk.
Hostile mobs can now spawn in higher light levels at lower depths, using the formula 16 − (Layer / 8). At level 8 and below, mobs could spawn even in sunlight.
v1.2.1Hostile mobs can no longer spawn in higher light levels at lower depths.
?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.
Java Edition Beta
1.8Pre-releaseThe player's spawn point is now bound to a specific biome rather than to any sand block (when this was first the case is unknown). The player can spawn in forest, swamp and taiga biomes.
Previously, mob spawning was determined by light level rather than the current chunk properties. This was no longer the case in Beta 1.8. In a pre-Beta 1.8 world, hostile mobs would spawn in light level 7 or lower while friendly mobs would spawn in light levels 9 or higher. Because of this, hostile mobs had a slight chance of spawning even though it was light due to them spawning in the air where there was little light. If you had a lot of torches down, go down to your mine, then return, you would have a tendency to find your house having some cows, pigs, chickens or sheep running about.
Java Edition
1.112w01aThe biomes valid for the player's spawn location were adjusted. Players can now spawn in forest, plains, taiga, forest hills and taiga hills biomes.
1.2.112w03aThe player's spawn point can now also be located in jungle and jungle hills biomes.
1.4.212w32aAdded doMobSpawning gamerule to toggle mob spawning.
1.814w25aMost restrictions on the pack location are removed. Formerly it had to be an air block, now any non-opaque block suffices.
1.915w46aWhen spawning mobs, the spawning block cannot block movement (formerly just had to be non-opaque) and cannot be any type of rail. Also the block above can no longer be liquid.
15w51aAdded spawnRadius gamerule to control the size of the world spawn area.
pre2Pack spawning mechanics adjusted, "12 attempts" is now "up to 12 attempts" and is even more heavily weighted toward the center.
1.1519w37aWhen breedable mobs spawn naturally in a group, the group now sometimes includes babies. (Has a 5% or 10% chance depending on the animal.)
1.1620w18aMobs that are riders of other mobs and entities (like boats and minecarts) no longer despawn.
Added the spawn cost/charge system that reduces hostile mob spawn rates in soul sand valley and warped forest.
Added a new section to the debug screen, which covers the spawning of mobs in each category.
1.1721w13aAdded a new mob cap category for axolotls and glow squids.
1.18Experimental Snapshot 1Hostile mobs now spawn only in light level 0.
experimental snapshot 3Mob spawning is now consistent at all altitudes, making spawn rates at all Y-levels approximately equal to the previous spawn rate at Y=64.
experimental snapshot 5The spawn rate changes in experimental snapshot 3 have been reverted.
21w37aAxolotls now have their own mob cap, separate from glow squids.
21w40aAxolotls now spawn only when there is a clay block less than five blocks below the spawning space.
21w42aReworked world spawn selection algorithm. Players now spawn according to the same climate parameters that control biome placement and world generation: players should no longer spawn in the ocean or some other inconvenient locations.
1.18.222w07aAquatic mobs now spawn only if the block above is a non-waterlogged water block, preventing fish from spawning inside bubble elevators.

Gallery[]

Issues[]

Issues relating to "Spawn" are maintained on the bug tracker. Report issues there.

Trivia[]

  • In Java Edition, the world spawn (the point where players spawn if they have no valid bed spawn) is usually a random (seed determined) point between -500 and +500 on the X and Z axis. If the chosen point is in water (due to nothing but ocean biomes in the -500 to +500 range), a second attempt is made between -1500 to +1500. If this fails due to ocean, the game gives up and puts the world spawn in the middle of the ocean (still at the surface) (attempting to play the flat lands preset Water World does this, for example). Normally, a player who spawns in the water does so near the shore because the world spawn itself picked a spot there.
  • In Bedrock Edition, an opaque block normally causes all blocks below it to spawn cave mobs, but not if a transparent block is placed on top.

References[]

  1. MCPE-120237
  2. https://www.minecraft.net/en-us/article/minecraft-snapshot-20w10a
  3. MC-1788
  4. a b c d Only 8 levels, since only blocks with solid top surfaces are spawnable. See MC-202376
  5. The 96-block horizontal limit is reported as a bug at MCPE-102197
  6. [1]
  7. MC-182897 – "Some passenger mobs don't count to the mob cap" – resolved as "Works As Intended"
  8. MC-182304
  9. MCPE-70664
  10. MCPE-34032
  11. MCPE-102302

External links[]

Advertisement