Namespaces

Variants

Share

Share
Actions

Trading

From Minecraft Wiki
Jump to: navigation, search
The trading interface displaying a trade of 28 paper for 1 emerald.

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

Contents

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 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 profession. 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 bottle 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 and prices may vary from villager to villager, and a villager's own quantities/prices may change when they generate new offers.

All villagers initially have only one offer to make. They can generate new offers when the last offer available (rightmost on their list of offers) has been traded at least once. Note that the trading GUI must be closed before a villager will generate a new offer. When they do, they become surrounded with purple and green particles for a moment. New offers may involve items a villager was already buying/selling: in this case, the newly generated offer will overwrite the previous one, allowing a villager's prices (or priest's enchantments) to change. Although there is no maximum limit on the number of offers an individual villager can make, they can only have one offer for each type of item they can trade. In addition, when a villager already has many offers, there is a high probability that a newly generated offer will be of an item they already offer: thus the old offer will be overwritten, and there will not be any new offer slot added to the villager.

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 if you close the interface after trading it (this is true even if all 13 trades have been done at once). Trading the last offer may activate an offer again.

Prior to the Pretty Scary Update (v1.4), it was possible to trade more than 13 times on a single offer because offers were not removed until the trading interface had closed. This meant you could buy an offer as many times as you could afford with one inventory. Currently, villagers can halt trading on a particular item once the conditions for deactivation have been met even if the trading window is still open. This can cause strange behavior in inventory when player is using shift and click when trading. At first it seems that all goods have been traded, but after taking an action in inventory the amount of emeralds and goods in user inventory changes. Once the trading window is closed and reopened, the offer will still be displayed, but red X's will indicate that the offer is no longer available. However, only one offer can be removed after the trading interface is closed: if you trade multiple offers beyond the limit, only the last one traded will be removed. In this way, an offer with more than 13 uses can be kept, and the game does not check offers for disabling until the offer is traded.

In addition, if an offer is the last offer available, it is never disabled even if its uses exceed 12. Once it is no longer the last offer, of course, it is eligible for being disabled. When an offer is disabled, it has the same particle effect as an offer being created.

Unfortunately, though, you cannot change what a villager will sell, so you will have to trade until all items are unlocked.

Possible offers

Quick reference trading chart

The following table lists the minimum and maximum offers that a villager will make when buying and selling items.

Farmer

Farmer.png
Buys
Item Quantity Price in
emeralds
Probability
Value[note 1]
Actual
Probability[note 2]
Prob. of Being Last Offer[note 3]

Wheat
18 – 21 1 0.9 16.0271% 0.0005%

Wool
14 – 21 1 0.5 8.2163% 0.0070%

Raw Chicken
14 – 17 1 0.5 8.2163% 0.0070%

Cooked Fish
9 – 12 1 0.4 6.4622% 0.0147%

Gold Ingot
8 – 9 1 N/A[note 4] 0.0044% 99.7591%
Sells
Item Quantity Price in
emeralds
Probability
Value
Actual
Probability
Prob. of Being Last Offer

Bread
3 – 4 1 0.9 16.0271% 0.0005%

Melon
5 – 8 1 0.3 4.7690% 0.0328%

Apple
5 – 8 1 0.3 4.7690% 0.0328%

Cookie
8 – 10 1 0.3 4.7690% 0.0328%

Shears
1 3 0.3 4.7690% 0.0328%

Flint and Steel
1 3 0.3 4.7690% 0.0328%

Cooked Chicken
7 – 8 1 0.3 4.7690% 0.0328%

Arrow
9 – 12 1 0.5 8.2163% 0.0070%

Flint
2 - 5 10
Gravel
and
1
Emerald
0.5 8.2163% 0.0070%

Librarian

Librarian.png
Buys
Item Quantity Price in
emeralds
Probability
Value
Actual
Probability
Prob. of Being Last Offer

Paper
24 – 35 1 0.8 24.8384% 0.0107%

Book
11 – 12 1 0.8 24.8384% 0.0107%

Written Book
1 1 0.3 7.9476% 0.5154%

Gold Ingot
8 – 9 1 N/A[note 4] 0.2666% 83.9531%
Sells
Item Quantity Price in
emeralds
Probability
Value
Actual
Probability
Prob. of Being Last Offer

Bookshelf
1 3 0.8 24.8384% 0.0107%

Enchanted Book
[note 5]
1 1
Book
and
5 – 64
Emeralds
0.07 1.7573% 11.0006%

Glass
4 – 5 1 0.2 5.1711% 1.4996%

Compass
1 10 – 11 0.2 5.1711% 1.4996%

Clock
1 10 – 11 0.2 5.1711% 1.4996%

Priest

Priest.png
Buys
Item Quantity Price in
emeralds
Probability
Value
Actual
Probability

Gold Ingot
8 – 9 1 N/A[note 4] 10.1246%
Sells
Item Quantity Price in
emeralds
Probability
Value
Actual
Probability

Eye of Ender
1 7 – 10 0.3 13.8203%

Bottle o' Enchanting
2 – 4 1 0.2 8.8493%

Redstone
2 – 4 1 0.4 19.2692%

Glowstone
2 – 3 1 0.3 13.8203%
Enchants[note 6]
Item Price in
emeralds
Probability
Value
Actual
Probability

Iron Sword
2 – 4 0.1 4.2645%

Iron Pickaxe
2 – 4 0.1 4.2645%

Iron Axe
2 – 4 0.1 4.2645%

Diamond Sword
2 – 4 0.1 4.2645%

Diamond Pickaxe
2 – 4 0.1 4.2645%

Diamond Axe
2 – 4 0.1 4.2645%

Iron Chestplate
2 – 4 0.1 4.2645%

Diamond Chestplate
2 – 4 0.1 4.2645%

Blacksmith

Blacksmith.png
Buys
Item Quantity Price in
emeralds
Price per Unit
in emeralds
Probability
Value
Actual
Probability

Coal
[note 7]
16 – 23 1 0.0435 - 0.0625 0.7 9.6382%

Iron Ingot
8 – 9 1 0.111 - 0.125 0.5 6.6765%

Gold Ingot
8 – 9 1 0.111 - 0.125 0.5 6.6817%[note 4][note 8]

Diamond
3 – 5 1 0.2 - 0.3333 0.5 6.6765%
Sells
Item Quantity Price in
emeralds
Price per Unit
Ingredient[note 9]
Probability
Value
Actual
Probability

Iron Sword
1 7 – 10 3.5 - 5 0.5 6.6765%

Iron Axe
1 6 – 7 2 - 2.33 0.3 3.8961%

Iron Pickaxe
1 7 – 8 2.33 - 2.67 0.5 6.6765%

Iron Shovel
1 4 – 5 4 – 5 0.2 2.5638%

Iron Hoe
1 4 – 5 2 - 2.5 0.2 2.5638%

Diamond Sword
1 12 – 13 6 - 6.5 0.5 6.6765%

Diamond Axe
1 9 – 11 3 - 3.67 0.3 3.8961%

Diamond Pickaxe
1 10 – 11 3.33 - 3.67 0.5 6.6765%

Diamond Shovel
1 7 7 0.2 2.5638%

Diamond Hoe
1 7 3.5 0.2 2.5638%

Iron Helmet
1 4 – 5 0.8 - 1 0.2 2.5638%

Iron Chestplate
1 10 – 13 1.25 - 1.625 0.2 2.5638%

Iron Leggings
1 8 – 9 1.14 - 1.29 0.2 2.5638%

Iron Boots
1 4 – 5 1 - 1.25 0.2 2.5638%

Diamond Helmet
1 7 1.4 0.2 2.5638%

Diamond Chestplate
1 16 – 18 2 - 2.25 0.2 2.5638%

Diamond Leggings
1 11 – 13 1.57 - 1.86 0.2 2.5638%

Diamond Boots
1 7 1.75 0.2 2.5638%

Chainmail Helmet
1 5 – 6 1 – 1.2 0.1 1.2659%

Chainmail Chestplate
1 11 – 14 1.375 – 1.75 0.1 1.2659%

Chainmail Leggings
1 9 – 10 1.29 – 1.43 0.1 1.2659%

Chainmail Boots
1 5 – 6 1.25 - 1.5 0.1 1.2659%

Butcher

Butcher.png
Buys
Item Quantity Price in
emeralds
Probability
Value
Actual
Probability

Coal
[note 7]
16 – 23 1 0.7 21.0549%

Raw Porkchop
14 – 17 1 0.5 14.0096%

Raw Beef
14 – 17 1 0.5 14.0096%

Gold Ingot
8 – 9 1 N/A[note 4] 0.794%
Sells
Item Quantity Price in
emeralds
Probability
Value
Actual
Probability

Saddle
1 6 – 7 0.1 2.5177%

Leather Cap
1 2 – 3 0.3 7.9357%

Leather Tunic
1 4 0.3 7.9357%

Leather Pants
1 2 – 3 0.3 7.9357%

Leather Boots
1 2 – 3 0.3 7.9357%

Cooked Porkchop
6 – 7 1 0.3 7.9357%

Steak
6 – 7 1 0.3 7.93571%

Generic Villager (green clothes)

Note: The green villager is only obtainable using /summon, server commands, mods, or third-party map editors on version 1.7.6 or lower. In the first 1.8 snapshots when the new villager professions were added, its number was changed to -1. It doesn't spawn naturally, even when using a spawn egg.

Buys
Item Quantity Price in
emeralds
Probability
Value
Actual
Probability

Gold Ingot
8 – 9 1 N/A[note 4] 100%

Notes

  1. Most offers have a probability value defined in the code. The larger the number is, the more likely the offer is. This is not exactly the probability of getting the offer: the game first compiles a list of potential offers, and the probability is used to determine whether the offer is included in this list. Then one offer is selected from this list at random to be the actual new offer generated.
  2. The actual probability of an offer depends on the probability values of all offers for a villager. These values were calculated by checking the probabilities of all possible lists of potential offers.
  3. This is the chance that the given trade offer will be the last one given by a villager when its options are completely exhausted. Offers with higher probabilities of being given are more likely to show up in the beginning of a villager's list of available trades, while rarer trades will be closer to last. For example, buying gold is frequently a villager's final trade offer, because it is rare for a villager to offer to buy gold. Only after many trades will buying gold be offered, so other offers will have taken the first spots on the villager's list of trade offers.
  4. a b c d e f
    Gold ingot offers do not have a probability value in the code, except for one of the two blacksmith offers. If no potential offers are generated, then the game will default to an offer of gold ingots. Note that this offer is more likely when all other offers have a low probability.
  5. The enchantment is chosen randomly, with equal chance of any enchantment type occurring and equal chance to get any level of it, so higher-leveled enchantments are as likely to get as low-leveled enchantments. The price in emeralds depends on enchantment level only. The possible values are 5 – 19 emeralds for Lvl I, 8 – 32 for Lvl II, 11 – 45 for Lvl III, 14 – 58 for Lvl IV and 17 – 71 for Lvl V.
  6. Priests will offer to enchant items for you. Every enchantment costs between 2 – 4 emeralds, and requests the item to be enchanted in the first slot. Trading for an enchanted item in this manner repairs the item if it is damaged, allowing items to have infinite durability at the cost of emeralds.

    When creating the enchantment offer, the game uses a random enchantment level from 5 – 19. For a listing of what enchantments will show up at these levels, see Enchantment Mechanics

  7. a b
    Villagers buy Charcoal as Coal in 1.7 versions, but not since snapshot 14w02a (1.8)
  8. The blacksmith actually has two chances to offer to buy gold ingots. This is because it is an explicit offer a smith may ordinarily make (0.5 probability value, or 6.6765% chance), and it is also a default offer for all villagers (with a 0.0052% chance from a blacksmith). Note that, despite two chances to generate a gold ingot offer each time an offer is generated, a blacksmith will never have two separate offers to buy gold ingots in the trading interface, because the offers involve the same items.
  9. "Price per Unit Ingredient" is the equivalent price per diamond gem or iron ingot that you would be paying if you were buying the diamonds or iron and then crafting the resulting tool or armor yourself. In the case of chainmail armor, these numbers are given for a theoretical comparison only, since chainmail cannot be player-crafted. In the case of tools, sticks used in the crafting of tools are ignored in the calculation.

Video

History

Beta
July 13, 2011 Notch 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), their Iron Golems will try to do the same to you
Raiding chests will anger the owners of the town/chest and they will attack.
May 21, 2012
Jeb released a screenshot of himself testing the Trading System. the image showed buying and selling areas.
Jeb also mentioned that this may be an end to non-renewable resources, supposedly as most can be bought for some price from NPCs.[1]
In the image, there is an item later revealed to be a ruby. It was changed before 12w21a, since one of the creators is colorblind and had trouble identifying it.
An ore block can be seen in the background later revealed in snapshot 12w21a to be Ruby Ore, it was changed to emerald ore before 12w21a because Dinnerbone is colorblind.[2]
Official release
1.3 12w21a Added villager trading.
12w22a Eyes of Ender are now sold by priests instead of bought, and rotten flesh is no longer bought.
The trading UI has been changed where an extra input space has been added where tools can be placed for buying enchantments and/or repair.
12w23a Prior to this snapshot, librarian defaulted to written books instead of gold ingots, since the written books had a potential offer of 1.3.
1.4 12w32a The librarian's paper offer was adjusted to 24-35 paper per emerald, and the farmer's arrow offer was corrected to 9-12 per emerald.
The offer probability mechanic was changed: as more offers exist for a villager, the probability of all offers rise. When an offer's probability goes beyond a certain limit, its probability goes down. The net effect is that rarer offers become more common when a villager has many offers, and common offers become rarer.
The offer removal mechanic has been replaced with an offer disabling mechanic.
All offers begin with 7 uses, allowing the offer to be traded up to seven times.
After this, even if the player has not left the trading GUI, the offer is disabled.
If a player trades the last offer on the list and closes the GUI, waiting for particles to appear around the villager, all disabled offers are renewed with 2-12 additional uses added to them.
It is possible for the final offer slot to be disabled, at which point no new offers can be generated and no existing offers can be renewed.
Trading with the last offer slot available will increase your popularity with the village by one point. Note that your popularity applies to the village as a whole, and other players' popularity is not affected.
1.4.6 12w49a Enchanted books were added, and villagers could offer them.
1.5 13w04a Villagers spawned from renamed spawn eggs will show their name in the trading interface in place of "Villager".
Upcoming
1.8 14w02a Villager trading has been revamped.
14w03a Villager Clerics no longer buy Ender Pearls, as they did in 14w02a.
Console Edition
TU14 Added villager trading.

1.8 Trading Revamp

This section contains content on features that may be included in the next update.
These features have appeared in development versions, but the full update containing these features has not been released yet.

In 14w02a, Villager trading has been revamped:

  • Villagers now spawn with careers.
    • Trades are now specific to career, and are unlocked in tiers
    • Villager career is now displayed in trade GUI.
  • Buying/selling any of the available options can unlock new tiers/reactivate available options. This is opposed to having to trade the last offer.
    • 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 attempts, it will only have a 20% chance of doing so.
  • New offers will no longer rewrite old ones. New offers are appended to the end of the villager's list.
  • Each tier consists of a defined set of trade offers, and the tiers are the same for any given career (see chart).
  • When a trade has deactivated, the red X will appear immediately and prevent further trading, instead of having to close and reopen the trading window.
  • Villagers now 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 still ignored, so the content of a written book does not matter.
  • Trading now gives experience, thus no bottle o' enchanting offer exists.
  • All villagers in your world before 14w02a+ will retain their previous trade offers, but will gain the new trading mechanics.

Different careers are assigned to each Villager (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).

Completing any trade offer with a Villager may unlock a subsequent tier of new offers and reactivate old ones. This is guaranteed the first time you trade a particular offer, and also has a 20% chance of occurring with subsequent trades to that offer.

The full list of careers and tiers is listed below:

Brown Robed Villager (Farmer)

Farmer.png
Farmer Buys Sells
Tier Item Quantity
Price
Item
Price
Quantity
1
Wheat
18 - 22 1
Bread
1 2 - 4

Potato
15 - 19 1

Carrot
15 - 19 1
2
Pumpkin
8 - 13 1
Pumpkin Pie
1 2 - 3
3
Melon
7 - 12 1
Apple
1 5
4
Cookie
1 6

Cake
1 1
Fisherman Buys Sells
Tier Item Quantity
Price
Item
Price
Quantity
1
String
15 - 20 1
Cooked Fish
6
Fish

1
Emerald
6

Coal
16 - 24 1
2 Enchanted[note 1]

Fishing Rod
7 - 8 1
Shepherd Buys Sells
Tier Item Quantity
Price
Item
Price
Quantity
1 White
Wool
16 - 22 1
Shears
3 - 4 1
2



















Colored Wool
16 offers containing each wool color, with varied prices.

1 - 2 1
Fletcher Buys Sells
Tier Item Quantity
Price
Item
Price
Quantity
1
String
15 - 20 1
Arrow
1 8 - 12
2
Bow
2 - 3 1

Flint
10
Gravel

1
Emerald
6 - 10

White Robed Villager (Librarian)

Librarian.png
Librarian Buys Sells
Tier Item Quantity
Price
Item
Price
Quantity
1
Paper
24 - 36 1
Enchanted Book
[note 2]
5 - 64 1
2
Book
8 - 10 1
Compass
10 - 12 1

Bookshelf
3 - 4 1
3
Written Book
2 1
Clock
10 - 12 1

Glass
1 3 - 5
4
Enchanted Book
[note 2][note 3]
5 - 64 1
5
Enchanted Book
[note 2][note 3]
5 - 64 1
6
Name Tag
20 - 22 1

Purple Robed Villager (Priest)

Priest.png
Cleric Buys Sells
Tier Item Quantity
Price
Item
Price
Quantity
1
Rotten Flesh
36 - 40 1

Gold Ingot
8 - 10 1
2
Redstone Dust
1 1 - 4

Lapis Lazuli
1 1 - 2
3
Eye of Ender
7 - 11 1

Glowstone
1 1 - 3

Black Apron Villager (Blacksmith)

Blacksmith.png
Armorer Buys Sells
Tier Item Quantity
Price
Item
Price
Quantity
1
Coal
16 - 24 1
Iron Helmet
4 - 6 1
2
Iron Ingot
7 - 9 1
Iron Chestplate
10 - 14 1
3
Diamond
3 - 4 1 Enchanted[note 1]
Diamond Chestplate
16 - 19 1
4
Chainmail Boots
5 - 7 1

Chainmail Leggings
9 - 11 1

Chainmail Helmet
5 - 7 1

Chainmail Chestplate
11 - 15 1
Weapon Smith Buys Sells
Tier Item Quantity
Price
Item
Price
Quantity
1
Coal
16 - 24 1
Iron Axe
6 - 8 1
2
Iron Ingot
7 - 9 1 Enchanted[note 1]
Iron Sword
9 - 10 1
3
Diamond
3 - 4 1 Enchanted[note 1]
Diamond Sword
12 - 15 1
Enchanted[note 1]
Diamond Axe
9 - 12 1
Tool Smith Buys Sells
Tier Item Quantity
Price
Item
Price
Quantity
1
Coal
16 - 24 1 Enchanted[note 1]
Iron Shovel
5 - 7 1
2
Iron Ingot
7 - 9 1 Enchanted[note 1]
Iron Pickaxe
9 - 11 1
3
Diamond
3 - 4 1 Enchanted[note 1]
Diamond Pickaxe
12 - 15 1

White Apron Villager (Butcher)

Butcher.png
Butcher Buys Sells
Tier Item Quantity
Price
Item
Price
Quantity
1
Raw Porkchop
14 - 18 1

Raw Chicken
14 - 18 1
2
Coal
16 - 24 1
Cooked Porkchop
1 5 - 7

Cooked Chicken
1 6 - 8
Leatherworker Buys Sells
Tier Item Quantity
Price
Item
Price
Quantity
1
Leather
9 - 12 1
Leather Pants
2 - 4 1
2 Enchanted[note 1]
Leather Tunic
7 - 12 1
3
Saddle
8 - 10 1

The green Villager is no longer obtainable, even using /summon, server commands, mods, or third-party map editors. Attempting to create one instead yields a Farmer.

The order of trades, including the order that they are unlocked, is the same for any given career of Villager. However, the prices and enchantments may vary between two Villagers of the same career.

  1. a b c d e f g h i
    When creating an enchantment offer, the game uses a random enchantment level from 5 – 19. For a listing of what enchantments will show up at these levels, see Enchantment Mechanics
  2. a b c
    The enchantment is chosen randomly, with equal chance of any enchantment type occurring and equal chance to get any level of it, so higher-leveled enchantments are as likely to get as low-leveled enchantments. The price in emeralds depends on enchantment level only. The possible values are 5 – 19 emeralds for Lvl I, 8 – 32 for Lvl II, 11 – 45 for Lvl III, 14 – 58 for Lvl IV, and 17 – 71 for Lvl V. Note that the cost is capped to 64, meaning that Lvl V books truly range from 17 - 64 emeralds, but costs at the upper end of the range are more common.
  3. a b
    Librarians offer the enchanted book trade three different times.

Issues

Issues relating to "Trading", "Trades", or "Trade" are maintained on the issue tracker. Report issues there.

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.
  • If you're not satisfied with the current trade offers, you can kill some of the villagers. The remaining villagers will start breeding again, resulting in possibly better offers. You can do this using environmental damage (fire, lava, TNT etc.) as not to aggravate the village's Iron Golem.
  • Gold armor is the only armor that cannot be traded for. (Butchers sell leather, and the blacksmith every other type.)
  • In the first Pre-release of the Beta 1.9 lost update, villagers had a "name bar" above their head similar to other players in multiplayer. Their name was "TESTIFICATE".

Prior to trading revamp

  • Charcoal can be sold as coal to blacksmiths and butchers.
  • Trading is currently the only legitimate way to get Bottles O' Enchanting without creative mode.
  • Gold Ingots are used as a fallback offer; any time a villager randomly selects none of its offers, it chooses to buy gold ingots instead. This is why gold is offered so rarely as a trade, and also why it is the green villager's only item.
  • It is possible, when trading for an Enchanted Book with a librarian, that the cost in emeralds exceeds 64. This only happens with books containing tier 5 enchantments.

Gallery

References