How it works
Each villager starts out with a single option to trade for something. For all purposes in this explaination, they will be known as "trade agreements" or simply just "agreements." Each trade agreement can be done a number of times before the villager no longer wants to honor it. This is usually five times, buy may vary. Completing the first trade agreement and then closing the trade window or interface, will cause the villager to enter a "thinking" mode, as well as give the villager an increased liking in the player, which is further explained below. A villager can have up to five trade agreements at one time, though can replace old ones with new ones past five. The only way to unlock more agreements is to trade with the villager, completing the last agreement unlocked at least one time. Once five has been reached, continuing to trade the final agreement will still reset the other agreements, allowing more trading, but also have a chance of replacing the current agreements with yet another new agreement.
Trading is a fast way of earning emeralds in survival as it is known as the only other "legitamate"
method of obtaining emeralds. In mulitplayer servers with npc villagers built in with villagers, players may act as highwaymen, or robbers, and kill players they believe may have just traded a villager for emeralds. To the right is an example of trading paper for emeralds:
The villager will "like" the player the more they trade with them. This is useful for really one one reasons, and that is to stop the iron golems in town from attacking the player, usually because the villagers are mad they were recently attacked by the player. Alternatively, the player may run and wait for awhile before returning for the iron golems to forgive/forget the player. Trading is usually hard unless done indoors while iron golems are present and the villagers are angry with the player.