Compass

Compasses are an item used to point to the world spawn. They are crafted using 4 iron ingots and one piece of redstone dust.

Trading
A single compass can be bought from a librarian villager for 10 to 12 emeralds as part of their tier 2 trades.

Expert-level librarian villagers have a $1/3$ chance to sell a single compass for 4 emeralds as part of their trades.

Usage
The compass needle points towards the world spawn point. The compass will point to spawn when viewed in any way, including as a dropped item, in a player's hand, in an inventory or the crafting table, or in an item frame. The compass shown on the topmost tab of the recipe book also points to spawn. The direction the needle points is relative to the player who is viewing it.

In the Nether or the End, the compass' needle will spin wildly and point in random directions.

Trading
A single compass can be sold to a cartographer villager for 1 emerald, as their tier 2 trade.

A single compass can be sold to an expert-level cartographer villager for 1 emerald, as part of their trade. A compass is also part of the cost of explorer maps: an ocean explorer map can be bought from a cartographer for 12–20 emeralds and a compass, and a woodland explorer map can be bought from a cartographer for 16-28 emeralds and a compass, as their fourth tier trades.

A compass is also part of the cost of explorer maps: an ocean explorer map and a woodland explorer map can be bought from a journeyman-level cartographer for 12 emeralds and a compass, as part of their trade. Woodland explorer maps can be bought from journeyman-level fletcher villagers for a compass and 12 emeralds as part their trade.

Trivia

 * A compass can be viewed under the item statistics page, as long as one has made a compass at some point in the past. It can also be viewed in the recipe book as the search tab's icon, or when the recipe for it if it has been unlocked.
 * A compass points to the northwest corner of a block, not the middle.
 * Using to change the world spawn will change where the compass points to.