Trading



The trading system is a gameplay mechanic that allows players to trade emeralds for items (and vice-versa) with NPC villagers.

Functionality
Right-clicking on a villager will open a GUI allowing a player to trade with the villager. Villagers will make offers based on their profession and career, and will only make trades based on what offers they are making. Different offers may be viewed by pressing the left and right buttons next to the currently displayed offer. All offers involve emerald as a currency, and some item pertinent to the villager's career. Trading allows the acquisition of uncommon items that would otherwise be fairly difficult to obtain, such as chainmail armor. It is also the only legitimate method of acquiring bottles o' enchanting in Survival mode.

A villager will never offer to buy/sell the same item at different prices or quantities (for example, no villager will offer to buy either 16 raw pork or 17 raw pork: there can only be one offer to buy raw pork). However, the quantities, prices, and enchantments may vary from villager to villager.

Different careers are assigned to each villager, and are viewable in the trading GUI. For example, brown-robed villagers can be fletchers or fishermen; blacksmiths can be armorers or weapon smiths; etc. Every villager spawns with tier 1 of their given career, which range from 2–4 initial unlocked trades (i.e. all shepherds will spawn with only two options, buying wool and selling shears). Each tier consists of a defined set of trade offers, and the tiers are the same for any given career (see the chart below). They can unlock new tiers when an existing offer is traded. Note that the trading GUI must be closed before a villager will unlock a new tier. When they do, they become surrounded with purple and green particles for a moment. Each career has a fixed sequence of tiers, and will only unlock a finite number of offers.

Villagers will deactivate an offer if the offer has been used some number of times and it is not the villager's only offer. The chance of an offer's deactivation is random, but an offer must be used at least 3 times before it is eligible for deactivation. After an offer has been used 13 times, it is guaranteed to be deactivated. Trading a different offer may activate an offer again. When an offer is disabled, a red X will appear in the trading interface, and it has the same particle effect as an offer being created.

An offer is guaranteed to reactivate available options (and unlock a tier, if some have not yet been unlocked) the first time it is traded. On subsequent trades, it will only have a 20% chance of doing so.

Villagers will distinguish between damage values, so different colors of wool cannot replace white wool, charcoal cannot be traded in place of coal, and damaged tools cannot be traded in place of fully repaired tools. NBT data, however, is ignored, so the content of a written book does not matter.

The full list of careers and tiers is listed below:

White Apron Villager (Butcher)


The green Villager is not obtainable, even using, other commands, mods, or third-party map editors. Attempting to create one instead yields a farmer.

Trivia

 * Right-clicking on a villager pauses that villager's pathfinding.
 * Right-clicking on a villager right after a killing blow is dealt will result in the player trading with a dead villager. The trade goes through without any problems.
 * You cannot trade with child villagers.