The Four Euclidean Spawning & Despawn Bands

Natural hostile mob spawning and despawning do not check chunk boundaries for player proximity; they evaluate true 3D Euclidean distance squared between the mob’s bounding-box origin and the nearest non-spectator player’s bounding-box origin. Every single game tick (20 Hz), Mob.checkDespawn() calls Entity.distanceToSqr(nearestPlayer) and compares d² against hard-coded squared radii (576, 1,024, and 16,384 on Java Edition).

Exact Game Formula
d² = (X_mob - X_player)² + (Y_mob - Y_player)² + (Z_mob - Z_player)² | r_horiz = √(16384 - ΔY²)

Where (X, Y, Z) are exact entity feet coordinates (bottom-center of hitbox, shown on the F3 XYZ line, NOT eye height). Instant despawn fires whenever d² > 16,384.0 (r > 128.0 blocks) on Java Edition, or d² > 1,936.0 (r > 44.0 blocks) on Bedrock Simulation Distance 4.

Between r = 0 and r > 128, the game enforces four distinct behavioral shells around every survival, adventure, or creative player:

  • Inner Exclusion Sphere (r < 24.0 blocks, d² < 576): Natural pack spawning in NaturalSpawner aborts immediately (along with a separate 24-block exclusion sphere centered on the world spawn point). Note that cage block spawners (dungeon Monster Spawner and 1.21 Trial Spawner blocks) ignore this inner exclusion and instead require a player within 16.0 blocks of the spawner block center.
  • Active AI & Zero-Despawn Shell (24.0 ≤ r ≤ 32.0 blocks, 576 ≤ d² ≤ 1,024): Hostiles spawn naturally, execute full pathfinding goals (including random wandering), and reset their internal idle counter (noActionTime = 0) every tick. Mobs in this 8-block-thick shell never randomly despawn.
  • Idle AI & Random Despawn Shell (32.0 < r ≤ 128.0 blocks, 1,024 < d² ≤ 16,384): Mobs increment noActionTime by +1 per game tick and suspend autonomous random strolling after reaching noActionTime > 100 (5 seconds). Once noActionTime > 600 (30.0 seconds without taking damage), each tick rolls a 1 / 800 despawn chance. Because random wandering halts beyond 32 blocks, any mob farm positioned > 32 blocks from the player must use active flushing (water dispensers, flying machines, shifting floors, or aggro/bait targets) rather than passive open-trapdoor walk-offs.
  • Instant Despawn Exterior (r > 128.0 blocks, d² > 16,384): Any mob whose class returns removeWhenFarAway() == true and lacks persistence (PersistenceRequired: 1b from a Name Tag, picked-up gear, or villager trade history) is discarded on the very next game tick before consuming mob-cap slots.
AFK Feet (Y=188) ΔY = 124 r = 128 Kill Floor Y=64 (Safe Radius = 31.7m) Euclidean Distance Bands < 24m : Zero Natural Spawns 24–32m: Full AI, No Despawn 32–128m: 1/800 Tick Decay Bedrock Sim Distance 4: Active: 24–44m ONLY > 44m : Instant Despawn!
Figure 1: Cross-section of a high-altitude AFK station at Y = 188 above a Y = 64 kill chamber. Lowering ΔY from 128 to 124 expands the horizontal safe chord from 0.0 blocks to a 31.7-block radius.

AFK Height Chord Math & The Feet-Coordinate Trap

The single most common mistake in sky-AFK farm construction is adding +128 directly to the kill-chamber floor elevation. Suppose your trident killer or campfire drop chute floor sits on top of block Y = 63, placing dropped mobs’ feet at Y_mob = 64.000. If you place a solid glass block at Y = 191 and stand on top of it, your F3 XYZ feet coordinate reads Y_player = 192.000 (with eye level at 193.62).

At ΔY = 192.0 - 64.0 = 128.0, the vertical component alone consumes the entire 128² = 16,384 distance budget! Solving for the horizontal safe radius on the kill floor gives r_horiz = √(16,384 - 128²) = 0.00 blocks. In a standard 2×2 drop chute centered at chunk corner (X, Z), mobs stand at offsets of ±0.5 to ±1.3 blocks from your exact horizontal center, producing d² = 16,384 + 0.5² = 16,384.25 > 16,384. Every single mob vanishes the tick its feet touch the kill floor, leaving zero drops while lighting zero surrounding caves.

Vertical Offset (ΔY = Y_player - Y_floor) ΔY² Consumed Remaining r_horiz² Safe Horizontal Radius on Floor Recommended Farm Footprint
128.0 blocks 16,384 0 0.00 blocks Unusable — any horizontal drift despawns mobs
127.0 blocks 16,129 255 15.97 blocks Single centralized 3×3 drop chute directly below player
126.0 blocks 15,876 508 22.54 blocks Standard single-core flushing creeper / general mob tower
124.0 blocks 15,376 1,008 31.75 blocks Quad-pod flushing farm with water streams converging inward
120.0 blocks 14,400 1,984 44.54 blocks Wide slime/witch pad array (must spawn-proof surface within 44.5m)
112.0 blocks 12,544 3,840 61.97 blocks Multi-chunk guardian or raid arena requiring wide kill-zone margin

32–128 Block Random Despawn Decay (1/800 Roll)

Even when every spawning pad and water channel stays strictly inside the 128-block outer sphere, slow mob transport silently destroys farm efficiency. Once a mob spawns at r > 32 blocks, it receives an exact 600 gt (30.0 second) grace window while noActionTime counts from 1 to 600. Starting on tick 601, the server executes random.nextInt(800) == 0 every game tick.

Because each tick beyond 30.0 s carries a survival probability of 799 / 800 = 0.99875, the probability that an undamaged mob survives an additional t seconds (20t ticks) past the 30-second threshold follows the exponential geometric law S(t) = (799 / 800)^(20t):

  • At 30.0 s total lifetime (0 s into decay): 100.0% of spawned mobs survive.
  • At 35.0 s total lifetime (100 gt into decay): (799/800)^100 = 88.24% survive (11.76% lost in water streams).
  • At 45.0 s total lifetime (300 gt into decay): (799/800)^300 = 68.71% survive (nearly one-third of drops vanish!).
  • At 57.71 s total lifetime (554 gt into decay): 50.0% median survival cutoff.

Consequently, every flushing cycle + water stream + drop-chute freefall must kill or damage the mob in under 30.0 seconds from the instant it spawns. Note that fall damage or magma/campfire ticks reset noActionTime back to 0, granting a fresh 30-second timer if you are transporting mobs into a secondary looting chamber.

Sub-Chunk Heightmap (maxY) Probability Dilution

Building a mob farm at Y = 200 over an ocean eliminates cave lighting, so why do technical SMP servers excavate massive bedrock perimeters down to Y = -64 instead? The answer lies in NaturalSpawner.getRandomPosWithin().

For each chunk spawn attempt, Java Edition picks a random (X, Z) column, looks up the highest motion-blocking block in that column (maxY, shown as the SH S / M heightmap value on the F3 debug screen), and chooses a uniform random integer Y between the dimension’s minBuildHeight and maxY + 1:

  • Overworld (minBuildHeight = -64 in 1.18–1.21.4): Vertical candidate count = (maxY + 1) - (-64) + 1 = maxY + 66 (or maxY + 65 up to maxY surface). A single spawning floor at Y = -63 capped by a roof at maxY = -60 rolls across just 6 vertical Y-values (16.7% vertical hit rate per floor!). Building that exact same single-floor farm in the sky at Y = 198 with a roof at maxY = 201 forces the RNG to roll uniformly across -64..202 (267 Y-values — 0.375% hit rate, or 44.5× fewer successful pack starts per column!).
  • Nether & End (minBuildHeight = 0): Vertical candidate count = maxY + 1 (or maxY + 2 inclusive of top check). An Enderman farm built on the void floor at Y = 1 (maxY = 3) achieves ~20–25% vertical hit concentration, saturating the 70-mob hostile cap with a tiny 9×9 leaf-ring platform, whereas a Nether-roof gold farm at Y = 250 (maxY = 252) pays a 1 / 253 heightmap penalty and must compensate with thousands of magma spawning spaces.

Also avoid extending solid opaque roofs horizontally past your farm walls without reason: any overhanging solid roof block raises maxY for empty air columns beneath it, wasting chunk spawn attempts that would otherwise roll across maxY = -64 void/ocean columns rapidly.

Java 1.21.4 vs. Bedrock Simulation Distance 4 (44 Blocks)

Java Edition (1.21.4)

  • Fixed 128.0-block spherical instant despawn radius regardless of server Simulation Distance (provided chunks are entity-ticking; below Simulation Distance 10, horizontal chunk ticking can clip outer edges, while vertical 128-block sphere always applies).
  • 70-mob per-player local/global hostile mob cap, evaluated every single game tick (20 Hz).
  • Heightmap maxY directly scales per-column spawn probability; lower Y-levels dramatically boost single-player farm rates.

Bedrock Edition (1.21.50)

  • Simulation Distance 4 (Default on all Realms, Mobile & Switch): Spawning occurs ONLY at 24 ≤ r ≤ 44 blocks, and instant despawn triggers at r > 44.0 blocks (d² > 1,936)! Standing 120 blocks above a Bedrock Realm farm produces literally zero drops.
  • Simulation Distance 6–12: Outer spherical despawn jumps to 128.0 blocks, bounded horizontally by the ticked chunk grid (96 blocks at Sim 6).
  • Separate surface vs. cave density caps (8 surface / 8 cave monsters for creepers/spiders) using top-down column scanning instead of Java’s uniform minY..maxY heightmap dilution.
In-Game Verification Test: Tested in Vanilla Java 1.21.4 superflat void world (minY = -64) using Carpet /tick warp 72000 (1-hour run) on an identical 15×15 flushing creeper pad. With the pad at Y = -62 (roof maxY = -59) and AFK feet at Y = 64.0 (ΔY = 126.0), hopper counters recorded 3,840 gunpowder/hr. Elevating the identical pad to Y = 190 (roof maxY = 193, AFK feet at Y = 316.0) dropped output to 412 gunpowder/hr (an 89.3% heightmap reduction). Raising AFK feet by +2.0 blocks to ΔY = 128.0 caused 98.6% of creepers to vanish upon touching the outer ring of the 3×3 kill chute (verified with F3+B hitboxes).