Considering the pretty common design (20x20 base) for the iron golem farms, what is the minimum distance from one golem farm to another to make them work correctly? And how is this "distance" calculated diagonally?
There is a good write up on Village mechanics on the Minecraft Wiki. For two villages to be safely treated as separate villages, they need to be greater than radius + 32 blocks away from each other.
Not that the radius is defined as:
- The distance from the center point to the furthest door, -OR-
- 32 blocks
whichever is greater. This means that the radius is always at least 32, no matter what, but it can be more than that if there are any houses further than 32 blocks from the center
So, if your Iron Golem farms are 20x20, and the center of the village is slap bang in the middle of that, then your radius is a further 10 blocks from one side of the farm, (i.e. 30 blocks). However, 30 < 32, so we take radius=32
radius + 32 = (32) + 32 = 64 blocks.
If you are working a lot with villages/golem farms, you might find this mod handy: Village Info Mod. It will help calculate how far you are from the village center, and other useful info.
Straight from the 1.14 code:
protected int villageDistance = 32;
protected final int villageSeparation = 8;
Though I don't think distance is checked in later versions.
From what I've seen, the requirements to spawn it is:
- The villager must be gossiping with another villager
- The villager has NOT recently slept AND worked
- The villager has not seen an iron golem recently
- The villager has a profession
- 5 villagers within 10 blocks meet those requirements (other than #1).
This is from the yarn deobfusication of Minecraft, I don't see any other requirements in the code.
Robotnik gives some quite advanced calculations but the simple answer is a door will generate a new village if it's registered more than 64 blocks (euclidean) away from the nearest registered door of an existing village.
After a new village is registered, another door can be registered belonging to it, lying even adjacent to previous door, making the villages overlap and their centers to be a block apart, but unless you want to perform mind-boggling wizardry like the Iron Trench to force order of registering doors, just make sure there is at least 64 blocks gap between doors of one farm and doors of the other.
Tango Tek stated the distance formula and said all calculations suggest a min. distance of 150 blocks of distance between the iron farm and any villages and a distance of 100 blocks between two iron farms. this is to keep the golems spawning in the farms and not inbetween them.....I have used his calculations on my own world and find them to be accurate as between my two farms I am cranking out 3500 - 5000 iron in an hour. both my farms drop into a killing chamber lined with hoppers the iron is transported to the automatic storage and the poppies are shot into a nether portal. the valid distance between 2 villages is 68.5 blocks or 69 since half blocks dont stack sideways.