Trading



The Trading system is a gameplay mechanic that allows Players to trade Emeralds for Items with NPC Villagers.

Information
Right clicking on a villager pauses that villager's pathfinding and opens up the trading window. The value for items in emeralds varies somewhat for each villager. Generally, villagers sell items at a high price and buy items at a low price.

Each villager offers up just one trade when they are initially spawned. Trading with a villager builds favor, and will open up new trading options. When this happens, purple particles spawn around the villager, and the new options are available to scroll in the GUI when the trade is started again.

Villagers will trade items that are related to their occupations:

Farmer

Sells: Buys:
 * Apple
 * Bread
 * Cooked Chicken
 * Cookie
 * Flint & Steel
 * Melon Slice
 * Shears
 * Raw Chicken
 * Wheat
 * Wool

Librarian

Sells: Buys:
 * Bookshelf
 * Compass
 * Glass
 * Book
 * Paper

Priest

Sells: Buys:
 * Bottle o' Enchanting
 * Glowstone
 * Redstone
 * Eye of Ender
 * Rotten Flesh

Blacksmith

Sells: Buys:
 * Any kind of iron, diamond and chain mail armor.
 * Any kind of iron and diamond tool.
 * Iron and diamond swords.
 * Diamond
 * Coal
 * Gold Ingot
 * Iron Ingot

Butcher

Sells: Buys:
 * Any kind of leather armor.
 * Any kind of cooked food.
 * Saddle
 * Coal
 * Any kind of raw food.

History
Before the Adventure Update, Notch once answered some questions about an idea he had, NPC Villages, where he revealed some thoughts about them:
 * If you treat the Villagers well (giving them items), they'll give you items back.
 * If you treat the Villagers badly (attacking/killing them), they'll try to do the same to you (feature added with Iron Golems).
 * Raiding chests will anger the owners of the town/chest and they will attack.

On May 21, 2012, Jeb released a screenshot of himself testing the Trading System. The image shows a GUI with buying and selling areas. The bottom area allows the player to sell various items for currency, whereas the top area uses this currency to purchase items. A possible way to buy them would be to put these currencies in the left slot, where the chicken is, and you can scroll through items for the right slot to take the item you choose once you click on it. The player may use the arrow buttons to scroll through a Villager's inventory and select the desired item. Jeb also mentioned that this may be an end to non-renewable resources, supposedly as most can be bought for some price from NPCs. In the image, a red currency item can be seen that was later revealed in snapshot 12w21a as the Emerald.

An ore block can be seen in the background which was later revealed in snapshot 12w21a to be a new Emerald Ore.

With the implementation of the trading system, most or all resources become "renewable" since nonrenewable resources can be traded from Villagers.

Bugs
In 12w21a 1.3 pre-release: Multi Emerald Trading with villagers has a bug: Bug1Bug2