Minecraft – How to protect the Iron Farm villagers from lightning

minecraft-java-edition

I am building an iron golem farm in the spawn chunks, and there is the problem of witches spawning in the villager cells, and that would break the iron golem farm. Bummer.

So, reading the wiki, I learned that

When lightning is to strike, random X and Z coordinates within the chunk are chosen, and the block just above the highest block that is liquid or blocks movement is chosen for the lightning strike. Then if there are any living entities that can see the sky in a 3×3×h region from 3 below the target block up to the world height, one such entity is selected at random and the lightning target is moved to the block the entity is standing in.

The target block is checked again for the following conditions:

  • Target block can see sky.
  • Rain (not snow) is falling in the target block.

If these conditions pass, lightning strikes.

When lightning strikes, all entities within a 6×6×12 region horizontally centered on the northwest corner of the target block with the bottom edge 3 below the target block are struck by lightning.

So basically if I put a roof over the villager cell, they should be safe, but I think that x12 on the last paragraph is height. Also it only targets entities if they can see the sky.

How should I build the roof to protect the villagers? How broad and how far high over them?

Related questions, none of the answers solve my particular issue, as I only need to protect the 4×4 area where the villagers will stand in.

(asks about fire-proofing buildings) How to lightning-proof a structure?

(asks about protecting the player) Preventing Lightning in Minecraft

(also about buildings) How can Buildings be Made Fireproof?

Best Answer

Based on the information on the wiki, a roof 3 blocks above the villagers, and covering them plus 3 blocks in all directions around them should be enough to prevent lightning from damaging them, as lightning will not be able to target blocks with an overhang, and the overhang is far enough that even if lightning strikes directly next to it, the villagers will be out of range of the damage.