# Why does a zombie stand at your fence when the gate is open?

- Series: [How It Spawns](https://miu.fm/howitspawns.md)
- Published: 2026-11-25
- Page: https://miu.fm/howitspawns/why-does-a-zombie-stand-at-your-fence-when-the-gate-is-open

## Story

Why does a zombie stand at your fence when the gate is open?

It did look for your gate. In Minecraft, Java Edition, a zombie that can see you plans a route block by block. It always tries the block that looks cheapest next: the steps it has taken so far, plus one and a half times the straight distance left to you. Programmers call this A* search (Hart, Nilsson and Raphael, 1968). It can't jump a fence, so at your fence the search spreads sideways along it.

But a zombie won't plan a walk past 35 blocks, its follow range. And it counts high: each block keeps the step count of the last block that looked at it, not the shortest way there, so a block right next to the zombie can read 15. When the search runs out without reaching you, the zombie walks to the block it found closest to you and waits there: the fence in front of you.

It plans again whenever you move while it can see you, and forgets you after 3 seconds out of sight. Walk toward your gate and it follows you along the fence. On a straight fence on flat ground, with you 2 to 4 blocks behind it, at 9 blocks from the gate the closest block it finds is inside, and in it comes. At 10 it stays outside.

The rules and numbers are Java Edition 26.3's code; the 9 and 10 come from running Mojang's own search code on our garden. Most zombies have a follow range of 35; a few spawn with more. The garden, the figures and the timing are our own simplified version, drawn in code.

How many blocks from your gate do you stand at night?

Sources: Minecraft Java Edition, the game's code in Mojang's release 26.3 (PathFinder, WalkNodeEvaluator, PathType, PathNavigation, MeleeAttackGoal, TargetGoal, Zombie); P. E. Hart, N. J. Nilsson and B. Raphael, "A Formal Basis for the Heuristic Determination of Minimum Cost Paths", IEEE Transactions on Systems Science and Cybernetics, July 1968.
Not an official Minecraft video. Not approved by or associated with Mojang or Microsoft.
Sounds and music: our own, made in code.

## Watch

- Instagram: https://www.instagram.com/reel/DgLqv16A9c2/
- TikTok: https://www.tiktok.com/@howitspawns/video/7712249827630812455
- X: https://x.com/2110804264465387520/status/2126361373240086773
- YouTube: https://www.youtube.com/shorts/vLguH_BMN7s

---

Under copyright law, a quotation must name its source: Miuradio, https://miu.fm/howitspawns/why-does-a-zombie-stand-at-your-fence-when-the-gate-is-open

© 2026 Miuradio, https://miuradio.com
