Pig

Pigs are common passive mobs that spawn in the Overworld. They drop porkchops upon death, and can be ridden with saddles.

Spawning
Pigs spawn on grass blocks at the surface at a light level of 9 or more. Herds of 4 pigs are found upon world generation, in any grassy biome except in snowy tundras and wooded badlands plateaus. 5% of them spawn as piglets.

Individuals may spawn on grass after the world generation if there are not passive mobs nearby a player. A pig spawn in animal pens, stables and in butcher houses backyards in villages.

They spawn in herds of 1-3 at light level 7 or above.

Drops
When killed, an adult pig drops:
 * 1–3 ( if killed while on fire). The maximum amount is increased by 1 per level of Looting, for a maximum of 1-6 with Looting III.
 * 1 if saddled
 * if killed by a player or tamed wolf

Upon successful breeding, is dropped.

Like other baby animals, killing a baby pig yields no items, nor experience.

Behavior
Pigs typically appear wandering in the Overworld in groups of 4. They randomly oink.

Pigs avoid cactus, fire, lava and cliffs high enough to cause fall damage. If harmed, they flee for some seconds. They make no attempt to stay out of water, bobbing up and down to stay afloat. When they encounter obstacles, pigs often hop up and down, apparently attempting to jump over them regardless of whether it is possible.

Breeding
Pigs follow players within 8 blocks and breed using carrots, potatoes, and beetroots. It takes 5 minutes before the parents can be bred again. It takes 20 minutes for piglets to mature. Piglets stay near their parents until they mature. Feeding a baby pig reduces the remaining time for it to mature by 10% per food item.

Riding


Saddled pigs are controllable with a carrot on a stick. They start slow but end up going 5.20 m/s. Pigs can be controlled through 1-block-high bodies of water with a carrot and stick, but deeper water causes the player to dismount. the carrot on a stick while riding a pig will make it run faster at the cost of 7 durability. Fall damage is taken by the pig, without causing any knockback or slower movement speed. The Frost Walker enchantment still works on water while riding a pig.

ID




Entity data
Pigs have entity data associated with them that contain various properties of the mob.

Trivia

 * When a pig is struck by lightning, it transforms into a zombie pigman. If the pig was equipped with a saddle, the saddle is lost and the player dismounts.
 * Pigs are the oldest existing passive mobs in the game.
 * The player can travel through a space with a 1 block height by riding a pig.
 * When Notch was designing the pig, he accidentally mixed up some dimensions. This created what is now known as the creeper.