Piglin

Piglins are hostile mobs that spawn in the Nether. They are equipped with crossbows or golden swords. They are naturally hostile toward the player, but become neutral if the player wears golden armor.

Spawning
Piglins spawn commonly in groups of 1–3 in crimson forest and uncommonly in the nether wastes biomes. Each piglin has a 25% chance of being a baby.

Adult piglins spawn with either golden swords or crossbows and occasionally wearing golden armor. Baby piglins spawn without any equipment.

Drops
Piglins have 8.5% chance of dropping their naturally-spawned equipment and drop it with random durability. Each level of Looting increases the chance by 1 percentage point (11.5% chance with Looting III).

Any picked-up equipment or other picked items have 100% chance of dropping and drop without changing the damage that has accumulated on it.

Naturally-spawned equipment

 * Random Golden Armor
 * Random Golden Armor
 * Random Golden Armor

Experience
Piglins drop experience if killed by the player or a tamed wolf.

Behavior
Piglins are hostile to the player, unless the player wears at least one piece of gold armor. With it, they become neutral, but still attack the player if provoked. Piglins are provoked by breaking or opening a chest, trapped chest, ender chest, barrel, or a shulker box in their sight, or mining a block of gold in their sight.

Piglins attack wither skeletons, but only if there is at least one other piglin nearby. They also attack adult hoglins occasionally. Baby piglins are passive and never attack anything. They also play with baby hoglins, running around. While playing baby piglins can ride on a baby hoglin for a bit before dismounting. However, if a player summons a baby piglin riding on a baby hoglin with commands, the baby piglin will immediately dismount from the baby hoglin. Iron golems attack both adult and baby piglins; piglins won't attack an iron golem until it attacks first.

When attacking, an adult with a crossbow shoots arrows every 2 seconds, and walks backward (stopping if at the edge of a drop) as soon as the enemy is close. Unlike bow-armed mobs, they do not strafe from left to right while shooting. Piglins with swords and other equippable items just rush at a player.

Piglins willingly downgrade to golden armor if they are wearing higher tier armor, or armor that has higher durability than gold, such as iron, chainmail, diamond, or netherite armor.

When in the Overworld, piglins transform into zombified piglins after about 20 seconds. When they transform, they lose all their armor and held items and gain a golden sword. Upon transformation, the newly spawned zombie pigman has the Nausea effect for 10 seconds. This does not occur in the End.

Piglins that are not currently attacking retreat from zombie pigmen, soul fire, soul fire torches, and soul fire lanterns. Piglins are capable of opening doors.

Piglins do not swim, and drown when submerged in water. They also receive damage from fire and lava.

Despite being a nether mob, piglins are not immune to fire damage unless affected by fire resistance.

Baby piglins never grow into adults.

Bartering
To barter with a piglin, a player either throws a gold ingot near the piglin or uses the gold ingot on it. The piglin then throws an item to the player and takes the gold ingot. During its six-second cooldown before it can barter again, the piglin holds the ingot as if examining it. Hitting a piglin causes it to put the ingot away. Piglins who are killed in one hit before they finish examining will not drop the ingot, resulting in it's loss.

Picking up items
Any piglin can pick up and equip any gold related item, regardless of their ability to pick up other items. While doing so, piglins "contemplate" the specific item by looking at it for a moment. Piglins that currently have crossbows can trade those out in order to hold any other gold related item instead (apart from gold ingots, which are consumed in bartering), even if it is not actually a weapon, and drop the crossbow on the floor.

Piglins have eight hidden inventory slots. Baby piglins attempt to pick up any item and can steal from players. Adult piglins can pick up any golden item and porkchops. Golden apples, their enchanted variant, golden carrots, and porkchops are the only items piglins store in their inventories.

Trivia

 * Piglins are one of only four mobs in the game that can willingly give items to a player.
 * Despite unlocking the "Monsters Hunted" or "Monster Hunter" advancement when killing them, they do not despawn in peaceful difficulty.
 * Piglins cannot ride on other entities; if summoned as a passenger they immediately dismount.
 * Piglins are also one of only two mobs that can wield crossbows, the other being pillagers.
 * A mob similar to piglins, the pigman, was a mob that was originally supposed to inhabit villages but scrapped in favor of villagers.