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).
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.0blocks,d² < 576): Natural pack spawning inNaturalSpawneraborts immediately (along with a separate24-block exclusion sphere centered on the world spawn point). Note that cage block spawners (dungeonMonster Spawnerand 1.21Trial Spawnerblocks) ignore this inner exclusion and instead require a player within16.0blocks of the spawner block center. - Active AI & Zero-Despawn Shell (
24.0 ≤ r ≤ 32.0blocks,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 this8-block-thick shell never randomly despawn. - Idle AI & Random Despawn Shell (
32.0 < r ≤ 128.0blocks,1,024 < d² ≤ 16,384): Mobs incrementnoActionTimeby+1per game tick and suspend autonomous random strolling after reachingnoActionTime > 100(5 seconds). OncenoActionTime > 600(30.0 secondswithout taking damage), each tick rolls a1 / 800despawn chance. Because random wandering halts beyond32blocks, any mob farm positioned> 32blocks 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.0blocks,d² > 16,384): Any mob whose class returnsremoveWhenFarAway() == trueand lacks persistence (PersistenceRequired: 1bfrom a Name Tag, picked-up gear, or villager trade history) is discarded on the very next game tick before consuming mob-cap slots.
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 stotal lifetime (0 sinto decay):100.0%of spawned mobs survive. - At
35.0 stotal lifetime (100 gtinto decay):(799/800)^100 = 88.24%survive (11.76%lost in water streams). - At
45.0 stotal lifetime (300 gtinto decay):(799/800)^300 = 68.71%survive (nearly one-third of drops vanish!). - At
57.71 stotal lifetime (554 gtinto 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 = -64in 1.18–1.21.4): Vertical candidate count =(maxY + 1) - (-64) + 1 = maxY + 66(ormaxY + 65up tomaxYsurface). A single spawning floor atY = -63capped by a roof atmaxY = -60rolls across just6vertical Y-values (16.7%vertical hit rate per floor!). Building that exact same single-floor farm in the sky atY = 198with a roof atmaxY = 201forces the RNG to roll uniformly across-64..202(267Y-values —0.375%hit rate, or44.5×fewer successful pack starts per column!). - Nether & End (
minBuildHeight = 0): Vertical candidate count =maxY + 1(ormaxY + 2inclusive of top check). An Enderman farm built on the void floor atY = 1(maxY = 3) achieves~20–25%vertical hit concentration, saturating the70-mob hostile cap with a tiny9×9leaf-ring platform, whereas a Nether-roof gold farm atY = 250(maxY = 252) pays a1 / 253heightmap 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 vertical128-block sphere always applies). 70-mob per-player local/global hostile mob cap, evaluated every single game tick (20 Hz).- Heightmap
maxYdirectly 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 ≤ 44blocks, and instant despawn triggers atr > 44.0blocks (d² > 1,936)! Standing120blocks above a Bedrock Realm farm produces literally zero drops. - Simulation Distance 6–12: Outer spherical despawn jumps to
128.0blocks, bounded horizontally by the ticked chunk grid (96blocks at Sim 6). - Separate surface vs. cave density caps (
8surface /8cave monsters for creepers/spiders) using top-down column scanning instead of Java’s uniformminY..maxYheightmap dilution.
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).