Two items of the same type are put into the input slots; the first one is the item to be repaired and the second one is to be merged into the first. The second items durability is added to the first, and if applicable, some or all enchantments from the second item are added.
Anvil RepairMain article:
An anvil can also repair items in two different ways. This costs experience levels, but unlike the grindstone, the anvil preserves or can even enhance the targets enchantments. The anvil can combine the enchantments on two similar items, or rename any item (not just the ones it can repair). The costs are complex, so a summary is given here.
The repair cost is stored in a
Two items of the same type and material can be placed anywhere on the crafting grid or grindstone, which results in a single repaired item. The durability of the repaired item equals the sum of the old items durability plus a repair bonus of 5% of the items maximum uses, up to a limit of the maximum durability for that item. Repairing gives a slight benefit in conserving inventory space, as it combines two non-stackable objects into one.
The repaired object is never enchanted even if both items were to have the exact same enchantments, with the exception of curse enchantments, which are transferred to the repaired item. Therefore, using a “junk” item in a repair may sometimes be useful for removing an unwanted enchantment from an item prior to enchanting it again. Tools made of different materials (for example, a wood and a stone pickaxe) cannot be combined.
How do I repair tools in Minecraft?
How do you fix mending tools?
Is there a command to repair tools Minecraft?
How do you repair enchanted items?