Trading/Before Java Edition 1.8

In Java Edition 1.8, trading was significantly revamped. This page is about the offers of trading before 1.8 was released.
== Differences ==
* Each robe had only one class of villager.
** Class was not displayed in the GUI.
* Villagers started with only one offer.
** Trading would unlock up to one offer randomly.
** Trade order was randomized.
** New offers no longer rewrite old ones.
* The locked trade icon appears without reopening the GUI and did not have a description.
** Offers could be unlocked only by trading the final trade.
* Trading did not give experience.
* Villagers would not distinguish items with same ID but different damage values. For example, they would accept Charcoal for Coal when buying.
* Gold Ingots were used as a fallback offer; any time a villager randomly selects none of its offers, it would choose 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 was possible, when trading for an Enchanted Book with a librarian, that the cost in emeralds would exceed 64. This only happened with books containing tier 5 enchantments.
== Possible offers ==
The following table lists the minimum and maximum offers that a villager would make before 1.8 when buying and selling items.
=== Farmer ===
Buys	Buys 	Buys 	Buys 	Buys 	Buys
Item	Quantity	Price inemeralds	ProbabilityValueMost 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.	ActualProbabilityThe 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.	Prob. of Being Last OfferThis 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.
 	18 – 21 	1 	0.9 	16.0271% 	0.0005%
 	14 – 21 	1 	0.5 	8.2163% 	0.0070%
 	14 – 17 	1 	0.5 	8.2163% 	0.0070%
 	9 – 12 	1 	0.4 	6.4622% 	0.0147%
 	8 – 9 	1 	N/AGold 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. 	0.0044% 	99.7591%
Sells	Sells 	Sells 	Sells 	Sells 	Sells
Item 	Quantity	Price inemeralds	ProbabilityValue	ActualProbability	Prob. of Being Last Offer
 	3 – 4 	1 	0.9 	16.0271% 	0.0005%
 	5 – 8 	1 	0.3 	4.7690% 	0.0328%
 	5 – 8 	1 	0.3 	4.7690% 	0.0328%
 	8 – 10 	1 	0.3 	4.7690% 	0.0328%
 	1 	3 	0.3 	4.7690% 	0.0328%
 	1 	3 	0.3 	4.7690% 	0.0328%
 	7 – 8 	1 	0.3 	4.7690% 	0.0328%
 	9 – 12 	1 	0.5 	8.2163% 	0.0070%
 	4 – 5 	10 and1 	0.5 	8.2163% 	0.0070%
=== Librarian ===
Buys	Buys 	Buys 	Buys 	Buys 	Buys
Item	Quantity	Price inemeralds	ProbabilityValue	ActualProbability	Prob. of Being Last Offer
 	24 – 35 	1 	0.8 	24.8384% 	0.0107%
 	11 – 12 	1 	0.8 	24.8384% 	0.0107%
 	1 	1 	0.3 	7.9476% 	0.5154%
 	8 – 9 	1 	N/A 	0.2666% 	83.9531%
Sells 	Sells 	Sells 	Sells 	Sells 	Sells
Item 	Quantity	Price inemeralds	ProbabilityValue	ActualProbability	Prob. of Being Last Offer
 	1 	3 	0.8 	24.8384% 	0.0107%
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.	1 	1 and5 – 64 s 	0.07 	1.7573% 	11.0006%
 	4 – 5 	1 	0.2 	5.1711% 	1.4996%
 	1 	10 – 11 	0.2 	5.1711% 	1.4996%
 	1 	10 – 11 	0.2 	5.1711% 	1.4996%
=== Priest ===
Buys	Buys 	Buys 	Buys 	Buys
Item	Quantity	Price inemeralds	ProbabilityValue	ActualProbability
 	8 – 9 	1 	N/A 	10.1246%
Sells	Sells 	Sells 	Sells 	Sells
Item 	Quantity	Price inemeralds	ProbabilityValue	ActualProbability
 	1 	7 – 10 	0.3 	13.8203%
 	2 – 4 	1 	0.2 	8.8493%
 	2 – 4 	1 	0.4 	19.2692%
 	2 – 3 	1 	0.3 	13.8203%
EnchantsPriests 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 Mechanics/Enchanting	EnchantsPriests 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 Mechanics/Enchanting	EnchantsPriests 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 Mechanics/Enchanting	EnchantsPriests 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 Mechanics/Enchanting
Item	Price inemeralds	ProbabilityValue	ActualProbability
 	2 – 4 	0.1 	4.2645%
 	2 – 4 	0.1 	4.2645%
 	2 – 4 	0.1 	4.2645%
 	2 – 4 	0.1 	4.2645%
 	2 – 4 	0.1 	4.2645%
 	2 – 4 	0.1 	4.2645%
 	2 – 4 	0.1 	4.2645%
 	2 – 4 	0.1 	4.2645%
=== Blacksmith ===
Buys 	Buys 	Buys 	Buys 	Buys 	Buys
Item 	Quantity	Price inemeralds	Price per Unitin emeralds	ProbabilityValue	ActualProbability
Villagers buy Charcoal as Coal in 1.7 versions and before.	16 – 23 	1 	0.0435 - 0.0625 	0.7 	9.6382%
 	8 – 9 	1 	0.111 - 0.125 	0.5 	6.6765%
 	8 – 9 	1 	0.111 - 0.125 	0.5 	6.6817%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.
 	4 – 5 	1 	0.2 - 0.25 	0.5 	6.6765%
Sells	Sells 	Sells 	Sells 	Sells 	Sells
Item 	Quantity	Price inemeralds	Price per UnitIngredient"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.	ProbabilityValue	ActualProbability
 	1 	7 – 10 	3.5 - 5 	0.5 	6.6765%
 	1 	6 – 7 	2 - 2.33 	0.3 	3.8961%
 	1 	7 – 8 	2.33 - 2.67 	0.5 	6.6765%
 	1 	4 – 5 	4 – 5 	0.2 	2.5638%
 	1 	4 – 5 	2 - 2.5 	0.2 	2.5638%
 	1 	12 – 13 	6 - 6.5 	0.5 	6.6765%
 	1 	9 – 11 	3 - 3.67 	0.3 	3.8961%
 	1 	10 – 11 	3.33 - 3.67 	0.5 	6.6765%
 	1 	7 	7 	0.2 	2.5638%
 	1 	7 	3.5 	0.2 	2.5638%
 	1 	4 – 5 	0.8 - 1 	0.2 	2.5638%
 	1 	10 – 13 	1.25 - 1.625 	0.2 	2.5638%
 	1 	8 – 9 	1.14 - 1.29 	0.2 	2.5638%
 	1 	4 – 5 	1 - 1.25 	0.2 	2.5638%
 	1 	7 	1.4 	0.2 	2.5638%
 	1 	16 – 18 	2 - 2.25 	0.2 	2.5638%
 	1 	11 – 13 	1.57 - 1.86 	0.2 	2.5638%
 	1 	7 	1.75 	0.2 	2.5638%
 	1 	5 – 6 	1 – 1.2 	0.1 	1.2659%
 	1 	11 – 14 	1.375 – 1.75 	0.1 	1.2659%
 	1 	9 – 10 	1.29 – 1.43 	0.1 	1.2659%
 	1 	5 – 6 	1.25 - 1.5 	0.1 	1.2659%
=== Butcher ===
Buys	Buys 	Buys 	Buys 	Buys
Item	Quantity	Price inemeralds	ProbabilityValue	ActualProbability
 	16 – 23 	1 	0.7 	21.0549%
 	14 – 17 	1 	0.5 	14.0096%
 	14 – 17 	1 	0.5 	14.0096%
 	8 – 9 	1 	N/A 	0.794%
Sells	Sells 	Sells 	Sells 	Sells
Item 	Quantity	Price inemeralds	ProbabilityValue	ActualProbability
 	1 	6 – 7 	0.1 	2.5177%
 	1 	2 – 3 	0.3 	7.9357%
 	1 	4 	0.3 	7.9357%
 	1 	2 – 3 	0.3 	7.9357%
 	1 	2 – 3 	0.3 	7.9357%
 	6 – 7 	1 	0.3 	7.9357%
 	6 – 7 	1 	0.3 	7.93571%
===Generic (green clothes) ===
Note: The green Villager is only obtainable using /summon, server commands, mods, or third-party map editors. It doesn't spawn naturally, even when using a spawn egg.
Buys	Buys 	Buys 	Buys 	Buys
Item	Quantity	Price inemeralds	ProbabilityValue	ActualProbability
 	8 – 9 	1 	N/A 	100%
=== Notes ===
de:Handel/Vor 1.8
es:Comercio/Antes de Java Edition 1.8
pt:Comércio/Antes da 1.8
ja:取引/1.8以前
uk:Торгівля/до 1.8
zh:交易/1.8前
ru:Торговля/до 1.8