8

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 4x4 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?

2

2 Answers 2

7

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.

4
  • "[...] with the bottom edge 3 below the target block are struck by lightning." 3 blocks between the villagers and the roof is enough, and probably aesthetically more pleasing than 12.
    – MrLemon
    Nov 5, 2015 at 21:55
  • @MrLemon indeed a 3 block gap between the head of the villagers and the beginning of the roof is enough. None the less, this one gets the green check. Feb 17, 2016 at 16:23
  • Just tested in Java Edition 1.15.2 in creative using a channeling trident and command /weather thunder. One does need 3 full blocks between the strike target and the villager in order to protect the second. 2 gap and a bottom slab above them is not enough. That wiki page is a bit confusing.
    – Andrei
    Jan 25, 2020 at 14:03
  • Also, successfully tested in all 4 directions if 3 blocks are enough.
    – Andrei
    Jan 25, 2020 at 14:26
-1

First you must create a very fast redstone clock and make power a command block with this command inside:

/kill @e[type=Lightning]

This will kill lightning before it can strike because in the 1.8 update lightning became an entity and also allow you to use entity commands using @e or entitydata but the clock must be very fast as lightning takes about 2 game ticks to hit the surface.
The best option is by using one of the fastest and simplest command block clocks To set up the clock you must first set up a command block type in

/setblock ~ 1~ ~ redstone_block 0 destroy

Then place a block of stone on top of the command block then on the top of the stone place another command block with this command inside:

/kill @e[type=Item,r=2]

Warning:do not take out the r=2 or all items will be deleted constantly.(r=radius) Now replace the stone with a redstone block finally place the kill lightning command block beside the redstone block now you are complete.

1
  • 1
    This is so profoundly not a survival suggestion.
    – Wormbo
    Dec 18, 2018 at 10:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .