An anvil is a block that can be used to rename items, add and modify enchants, and upgrade tools.
Usage[]
Anvils can be used for many different things, including;
Renaming items: put an item into one of the slots of an anvil, type a name into the bar at the top, and it will rename the item for the cost of one level of exp.
Repairing tools and armor: combine 2 of the same tool or armor in an anvil, and some of their durability will be healed. This is an unused feature, since the mending enchant heals these items using exp.
Upgrading tools and armor: a netherite ingot added to a diamond tool/armor upgrades it to its netherite version, rainbow ingot upgrades netherite to rainbow, and an endium ingot will upgrade rainbow to endium.
Moving/adding enchants: a book in the first item slot of an anvil will take up any applicable enchants on the second item, deleting it in the process. For example, a book + a diamond pickaxe enchanted with curse of stickiness 1 (in that order), will result in a book with the stickiness enchantment while the pickaxe will disappear. In the opposite order, items can only take up enchants from a book and will only take up enchantments associated with that item (can't have a hoe with loyalty I)
Custom enchants: there are two other text bars in an anvil, one "Custom Enchant Name" and "Custom Enchant Level." These can be used to apply an ineffective custom enchant that will show up in a "custom" category underneath the effective enchants on an item. This action requires 20 exp levels per level of custom enchant, so a level 1000 enchant will use up 20000 levels.
Obtaining[]
Anvils may be obtained from warden drops and random loot chests.
Anvils can be crafted using 3 iron blocks and 4 iron ingots.
History[]
0.372 | Added Enchanting Table and Anvil |
0.420 | Fixed combining wrong items in anvil |
0.755 | Added hints for Anvil, Furnace and Brewing recipes |
0.857 | Added preserving of enchantments in anvil
Allowed combining protection enchantments |
0.873 | Allowed to rename whole stack in anvil
Anvil will not override upper enchantment level |
0.900.152 | Fixed possible stacked item losing in anvil on renaming |
0.921.156 | Fixed max enchant limit bypass in anvil
Fixed enchanted sword dupe in anvil |
0.1052.174 | Allow reset custom stack name in anvil
Fixed anvil item disappearing on slot click when no levels |
0.1245.188 | Added ability to set custom enchant in Anvil
Fixed Custom enchants for Anvil and Grindstone |
0.1262.189 | Fixed level dupe using anvil + grindstone and custom enchants
Fixed lvl dupe in anvil with too big level |
0.1344.199 | Fixed renaming for whole stack in anvil |
Trivia[]
By renaming a Beacon in an anvil, you can change what the arrow says.
Gallery[]

Renaming an anvil, in an anvil

Custom enchanting a totem

Repairing iron armor

Enchanting leather armor

How to upgrade Diamond to Netherite

How to upgrade Netherite to Rainbow