You trap a zombie in a pit by your base, go mining, and come back to an empty pit. No hole, no smoke. The one you named is still there, and while you stand and watch, none of them ever goes.
Minecraft only keeps monsters near a player. Twenty times a second the game measures every monster's distance to the nearest player. Past 128 blocks it's deleted on the spot. Within 32 it's safe. In between, once nobody's been within 32 blocks for thirty seconds, every tick it has a 1 in 800 chance of being deleted: half are gone about half a minute later, and after a few minutes away your pit is almost surely empty. A name tag switches the check off, and so does a zombie picking up your sword.
Why delete them at all? The game spawns monsters in the dark around you, never within 24 blocks, and stops once it counts 70 around you. Every one it forgets far away makes room for a new one near you. Named ones aren't even counted.
The 128, the 32, the thirty seconds and the 1 in 800 are already in the June 2010 Infdev build, and Java Edition 26.3 still runs them.
The world, the monsters and the run of the rule are our own simplified version, drawn in code; the numbers are the game's. The clocks at the turn are shown sped up.
What would you name yours?
Sources: Minecraft Java Edition, the game's code in Mojang's releases Infdev 2010-06-18, Alpha 1.0.4 and 1.2.6, Beta 1.7.3, 1.8.9 and 26.3: Mob.checkDespawn, MobCategory, NaturalSpawner, LocalMobCapCalculator, NameTagItem.
Not an official Minecraft video. Not approved by or associated with Mojang or Microsoft.
Sounds and music: our own, made in code.
