In Bedrock Edition, an iron golem can spawn naturally when a village first generates in the world. Iron golems also spawn in villages having at least 20 beds and 10 villagers. The golem attempts to spawn in a 16×6×16 volume around the village center defined by a bed, a bell, or another meeting point.
Why won't my villagers spawn iron golems?
Placing them too high or too low will inevitably ruin the structure and won't allow the iron golems to spawn, meaning that the farm is of no use until you fix the problem. A lack of villagers could also be the reason, as there are at least 10 needed for the farm to work properly and the golems to continue spawning.
What type of villagers do you need for an iron golem farm?
Spawning requirements
Villages attempt to spawn iron golems around the village center when the following requirements are met: The village contains at least 20 beds. The village contains at least 10 villagers. 100% of villagers are linked to a bed.