Villager trading in Minecraft
Since version 1.14, Villager trading has been an essential part of Minecraft's gameplay. It offers some very important items, including ones that can be very hard to get otherwise, and allows the player to acquire specific enchanted books without rolling the enchantment table over and over again.
Zombie Villagers & Reputation
Zombie Villagers are mobs that have a 5% chance to spawn instead of a zombie whenever the game would normally spawn a zombie. They have the same mechanics as zombies -- they can hold items, can wear armor, and will burn in daylight. However, Zombie Villagers are unique in that they can be cured by splashing them with a weakness potion and then feeding them a golden apple.
Once cured, a Zombie Villager will turn into a normal Villager, who will then give the player heavily discounted trades. This discount is not permanent; it will go away based on the player's reputation, and on the game's supply-demand mechanic.
Player reputation is effectively how much a given group of Villagers likes or dislikes the player. While discounts from curing a Zombie Villager is Villager-specific, other forms of gaining and losing reputation are specific to villages and groups of villagers. Higher reputation results in discounted trades, and lower reputation results in higher-priced trades.
Gain reputation by:
Curing a Zombie Villager (only applies to the cured Villager)
Splashing Villagers with healing potions
Having the "Hero of the Village" status effect, which lasts for a certain duration after defeating a raid (applies to all Villagers traded with while the player has the effect)
Lose reputation by:
Hitting or killing Villagers
Hitting or killing iron golems around the Villagers they're protecting
Failing to defeat a raid
Villager trades -- especially discounted ones -- are designed to go up in price if the trades are frequently used. This is a function of Minecraft's supply-demand mechanic; if there is high demand from the player, the price will go up.
Professions & Important Trades
Villagers have different professions based on the job block they link up to. Below is a list of all the professions, the blocks that they need, and the important trades they have. Once a Villager has been traded with in one profession, their profession will not change, even if their job block changes.
Armorer (Blast Furnace)
At their second highest level, Armorers will offer randomly-enchanted diamond leggings or boots. At their highest level, they will offer randomly-enchanted diamond helmets or chestplates.
Armorers are most useful for their emerald trades. When they were cured from being a zombie, they can trade one iron for one emerald, which is very useful if you have an iron farm.
Butchers trade for and using raw and cooked meats. If you have high-output animal farms, this can be helpful for getting emeralds, but generally iron farms are more efficient.
Cartographer (Cartography Table)
Cartographers are important because they offer both Ocean Explorer and Woodland Explorer maps for emeralds and a compass. These lead to ocean monuments and woodland mansions respectively. This is generally the most efficient way to find woodland mansions, which can be tens of thousands of blocks away from spawn.
Cleric (Brewing Stand)
Clerics will trade emeralds for rotten flesh, gold, glass bottles, and nether wart. They also offer bottles of enchanting.
Farmers will trade emeralds for crops. At their highest level, they give golden carrots for emeralds, which are the best food source in the game.
Fishermen trade emeralds for coal, raw fish, boats, and string.
Fletcher (Fletching Table)
Fletchers trade emeralds for sticks, flint, string, feathers, and tripwire hooks.
At higher levels, they offer randomly-enchanted bows and crossbows.
At their highest level, they trade a random tipped arrow for arrows and emeralds.
Leatherworkers trade emeralds for leather, flint, rabbit hide, and scutes.
At their highest level, they trade saddles for emeralds.
Librarians are arguably the most useful Villagers in the game. They offer enchanted books for regular books and emeralds. By breaking and re-placing the lectern (causing them to lose and then regain their job, resetting their trades if they have not been traded with yet) the player can roll and re-roll for a specific enchantment book. Librarian Villagers can offer any enchanted book in the game at any level (except for Soul Speed).
At their highest level, they also trade nametags for emeralds, which are very useful but uncraftable and fairly rare to find.
Stonecutters trade emeralds for clay, stone, granite, andesite, diorite, and quartz, making them a good option for getting lots of emeralds.
Shepherds trade emeralds for different colors of wool and different dyes.
Toolsmith (Smithing Table)
Toolsmiths trade emeralds for coal, iron, diamonds, and flint. At their higher levels, they offer randomly-enchanted diamond tools.
Weaponsmiths trade emeralds for coal, iron, flint, and diamonds. At their higher levels, they offer randomly-enchanted diamond swords and axes.
Wandering Traders randomly spawn in the world near the player. Like Villagers, they offer items for emeralds, but they don't offer emeralds for items. The items they offer vary wildly and are rolled from a large table of possible items, including flowers, corals, saplings, seeds, mushrooms, sand, dyes, ice, and other natural blocks/mob drops. In 1.17, Wandering Traders also sometimes offer moss blocks, which is one of only two ways to get moss in that version (the other being from shipwreck chests).
Piglin Bartering is similar to Villager trading, without profession mechanics or a GUI. To barter with Piglins, the player must approach an adult Piglin and drop a gold ingot near them (if the gamerule mobGriefing is set to false, the player needs to right-click the Piglin with the ingot). The Piglin will pick up the ingot, examine it for a moment, and then throw an item from the bartering table to the player. Even if the Piglin is otherwise hostile towards the player, they will still examine the ingot. Piglins will also examine other gold items (such as armor, tools, and weapons) but will not offer items in exchange.
If the player hits a Piglin while they are examining an ingot, the Piglin will not complete the barter, and will become hostile toward the player while keeping the ingot (but they will drop the ingot if they are killed in one hit). If a baby Piglin picks up the ingot, they will steal it and won't drop any bartering items. Zombie Piglins and Piglin Brutes cannot be bartered with.
Many items are on the bartering rewards table, including Fire Resistance potions, ender pearls, string, obsidian, crying obsidian, iron nuggets, gravel, blackstone, spectral arrows, and quartz. Soul Speed I, II, and III boots and enchantment books are also on this table, and this method is one of two possible ways to get this enchantment (the other being from bastion chests).
Trading -- whether with Villagers, Piglins, or Wandering Traders -- and Minecraft's economy mechanics are a very important part of the game, especially for mid and late-game players trying to max out their armor and tools, get specific enchantments, get lots of emeralds, or even get specific blocks or items like terracotta, dyes, moss, and corals.