Skip to main content
← All Guides
Redstone & Mechanics · 11 min read

How Mob Spawning Works in Minecraft

Deep dive into Minecraft mob spawning: light levels, mob caps, spawn algorithm, despawn rules, and how to exploit them for efficient farms.

Understanding mob spawning is the single most important piece of knowledge for building efficient farms. Every design decision, from platform placement to AFK spot location, depends on spawn mechanics. This guide covers the complete spawning algorithm used in Minecraft 1.21+ Java Edition, with notes on Bedrock differences where relevant.

The spawn cycle

Minecraft runs a spawn cycle once per game tick (1/20 of a second, 20 times per second). Each cycle, the game attempts to spawn mobs in eligible chunks around each player. The cycle is divided into mob categories: hostile mobs, passive mobs, water creatures, ambient mobs, and underground water creatures. Each category has its own mob cap and spawn rules.

Mob caps

The mob cap limits how many mobs of each category can exist simultaneously. In singleplayer:

CategoryCapExamples
Hostile70Zombies, skeletons, creepers, spiders, witches, endermen
Passive10Cows, sheep, pigs, chickens
Water creature5Squid, dolphins
Water ambient20Tropical fish, cod, salmon, pufferfish
Ambient15Bats
Underground water5Glow squid

On multiplayer servers, the mob cap formula on Java (1.18+) is: cap = base_cap x (chunks_in_range / 289). This means the effective cap scales with the number of loaded chunks per player. On Bedrock, the cap is a flat number per player regardless of loaded chunks, typically 8 for surface hostile mobs.

Spawn distance rules

Mobs can only spawn between 24 and 128 blocks from the nearest player:

  • Within 24 blocks: No spawning. Mobs already here do not despawn.
  • 24-32 blocks: Spawning zone. New mobs appear here.
  • 32-128 blocks: Spawning zone. Also eligible for random despawn attempts (each mob has a 1/800 chance per tick of despawning).
  • Beyond 128 blocks: Instant despawn. Any mob more than 128 blocks from every player is immediately removed.

This is why AFK spots matter enormously. Your farm's spawning platforms must be between 24 and 128 blocks from your AFK position. Platforms closer than 24 blocks produce nothing. Platforms beyond 128 blocks are ignored entirely.

Light level requirements (1.18+)

Since Minecraft 1.18, hostile mobs spawn only at light level 0 (complete darkness). Before 1.18, the threshold was light level 7. This change made spawn-proofing easier: a single torch covers a large area because it only needs to bring every block above 0.

Passive mobs spawn on grass blocks at light level 9 or higher (or any light level in the initial world generation). Most passive mobs only spawn during initial chunk generation and do not respawn naturally.

The spawn algorithm step by step

  1. The game selects a random block position in a loaded chunk within spawn range of a player.
  2. It checks if the Y level has a valid spawning surface (solid block below, sufficient space above).
  3. It checks the light level at the spawn position. For hostile mobs, this must be 0.
  4. It selects a mob type based on the biome's spawn pool and weight values.
  5. It checks if the mob's hitbox fits without colliding with blocks or entities.
  6. It checks if the mob cap for that category has room.
  7. If all checks pass, the mob spawns. If any check fails, the attempt is wasted.

Many spawn attempts fail. The game does not retry failed attempts. This is why clearing unused spawn surfaces (spawn-proofing) is so important, it reduces the number of failed attempts by removing invalid spawn locations from the random selection pool.

Spawn-proofing methods

To prevent mob spawning on a surface:

  • Light level 1+: Any light source works. Torches, lanterns, glowstone, sea lanterns, froglights, shroomlights.
  • Bottom slabs: Mobs cannot spawn on bottom-half slabs. This is the cheapest method for large areas.
  • Carpet: Technically transparent, but mobs can spawn on carpet. Not a reliable spawn-proof method.
  • Buttons and pressure plates: These prevent spawning on the block they sit on.
  • Water: Hostile mobs (except drowned) cannot spawn in water.
  • Glass and leaves: Transparent blocks do not allow spawning on top.

Despawn rules

Mobs follow these despawn rules:

  • Mobs with custom names (name tags) never despawn.
  • Mobs holding picked-up items never despawn.
  • Persistent mobs (tamed animals, villagers, iron golems, etc.) never despawn.
  • All other mobs have a 1/800 chance per tick of despawning when 32-128 blocks from the nearest player.
  • All non-persistent mobs instantly despawn when beyond 128 blocks from every player.

For farm design, the 128-block despawn radius is critical. If your kill chamber is more than 128 blocks from you, mobs despawn before being killed. If your platforms are beyond 128 blocks, nothing spawns.

Pack spawning

The game does not spawn mobs one at a time. It spawns them in packs. For hostile mobs, a pack is typically 1-4 mobs of the same type spawning near each other. The pack spawn origin is the random position selected in step 1 of the algorithm. Pack members spawn within a few blocks of the origin. This is why you sometimes see clusters of the same mob type together.

Biome-specific spawning

Each biome has a spawn pool: a list of mobs that can spawn there with weight values. Higher weight = higher chance. For example, in a plains biome, zombies have high weight while witches have low weight. The End has only Endermen in its pool, which is why Enderman farms in The End are so efficient. The Nether has its own pools per biome (warped forest has only Endermen, soul sand valley has skeletons and ghasts, etc.).

Practical implications for farm design

  • AFK spot: Place it so all spawning platforms are 24-128 blocks away. Closer to 24 blocks gives higher spawn attempts per platform.
  • Platform location: Build in dimensions/biomes with small spawn pools. The End (only Endermen) and specific Nether biomes give the highest concentration of desired mobs.
  • Spawn-proofing radius: Cover all spawnable surfaces within 128 blocks of AFK. Every zombie spawning in a cave steals a mob cap slot from your farm.
  • Kill speed: Mobs occupying the mob cap prevent new spawns. Kill mobs quickly to free cap slots. Entity cramming, fall damage, and lava are fastest.
  • Platform size: Larger platforms have more spawn-eligible blocks, increasing the chance that a random position selection lands on your platform.

Java vs Bedrock spawning differences

FeatureJavaBedrock
Mob capScales with loaded chunks per playerFlat cap per player (8 surface hostile)
Spawn distance24-128 blocks from player24-44 blocks (simulation distance dependent)
Despawn distance128 blocks instant, 32+ randomSimulation distance boundary
Light requirement (hostile)Light level 0Light level 7 or less (varies by version)

Common misconceptions

  • "Mob spawners ignore mob caps." Partially true. Spawners have their own check: they only check for 6 mobs of the same type within a 9x9x9 area, not the global cap. But global caps still limit natural spawns near spawner farms.
  • "Lighting an area stops all spawning." Only hostile spawning. Passive mobs, water creatures, and other categories have their own rules.
  • "Mobs spawn more at night." On the surface, yes (because light level drops to 0). Underground, time of day has no effect since light is always 0 in unlit caves.

Need a server? Astroworld Hosting runs NVMe SSDs and Pterodactyl panel on every plan.

Related Tools & Resources

🔧

Minecraft Tools

Calculators, generators & server tools

🧱

Item Database

Browse all Minecraft items, stats & recipes

⚒️

Crafting Recipes

Visual crafting guides for every recipe