An anvil is useful in Minecraft to repair items without breaking the enchantment. An anvil can also combine enchantments and rename items. An anvil is more complicated than a crafting table, and it requires experience points (earned by completing tasks in the game, and by killing mobs) and materials in order to repair an item.
Like many of the items an anvil repairs — including tools, weapons, and armor — an anvil becomes damaged with use and lasts, on average, for only 24 uses. After you craft an anvil, it opens its own menu when you right-click it.
To repair or enchant an item, follow these steps:
Place the item in the first slot.
Place the sacrifice piece in the second slot.For enchantments, you place the enchantment book in the second slot. For other items, you place an ingredient (such as iron ingot to repair an iron sword) in the second slot.The game calculates the cost of the repair and determines whether you have enough experience points (seen as the bottom bar below the hearts) to complete the repair. (This statement does not apply to Creative mode.) Repairing on an anvil is generally only desirable to preserve enchantments.
You can drop an anvil and inflict considerable damage on mobs and players (the anvil will not be damaged).
An anvil is one of the more expensive items to craft, because it requires more iron than a complete set of iron armor. To craft an anvil, place 3 blocks of iron on the top horizontal row, 3 iron ingots on the bottom horizontal row, and 1 iron ingot in the middle square. Then you have a total of 31 iron ingots (blocks are composed of 9 iron ingots apiece).