What are the exact spawn requirements for an Iron Golem in Minecraft Java 1.21?
In Java Edition, an Iron Golem spawns when at least 3 villagers are panicked by a zombie (within an 8-block line of sight), have slept within the last 20 minutes, and have not spawned a golem in the last 30 seconds. The game searches a 16x13x16 block volume centered on the panicked villager.
How do you prevent Iron Golems from spawning outside your farm platform?
Spawn-proof all surfaces within 16 blocks of your villagers by placing bottom-half slabs, glass, leaves, buttons, or water sources. Iron Golems can only spawn on full solid opaque blocks with at least a 2x3x2 block air space.