Repair weapons, armor or tools by right-clicking on an anvil (Iron Block) with a damaged item. Items are repaired with the materials used to create the item, for example, repair an iron sword with an iron ingot. If the item is enchanted, you have a chance to lose or downgrade the enchantment based on your repair level. Arcane forging/repair levels below..
Rank 1: Repair 100xp
70% keep enchantment, 50% chance enchantment is downgraded
Rank 2: Repair 250xp
80% keep enchantment, 40% chance enchantment is downgraded
Rank 3: Repair 500xp
85% keep enchantment, 30% chance enchantment is downgraded
Rank 4: Repair 750xp
90% keep enchantment, 20% chance enchantment is downgraded
Some players are doing repairs for free in order to level up their REPAIR so if you aren’t a high enough level to repair diamond (50xp), ask around! Otherwise you might want to pay a higher level repairer to repair your enchanted item for a better chance it keeps it’s mojo.