My pig has just turned into a zombie pigman. I have tried putting them inside, but they still turn into the pigmen!
23 Answers
Lightning only strikes straight down, but can transform a pig within 3-4 blocks of the lightning strike. Therefore, to keep your pigs safe from lightning storms, their shed has to be built so that it keeps them at least 5 blocks away from the outside sky. Building a 5 block wide overhang around the shed roof should do it. Alternatively, make your barn so that the pigs are in an inner chamber, with less "volatile" livestock like chickens and cows in the chambers near the walls.
1Dig a 5 by 5 hole 10 blocks deep, and build stairs with a door at the top so the pigs wont get out. Put torches so no mobs can spawn, and build a roof out of any material except wood.
It's probably the lightning. You should probably put your pigs underground if it happens a lot. It never happens for me though. Not once. But try putting them underground, or just keeping them indoors, so lightning doesn't hit them.