Item repair

Item repair is a feature that allows players to repair damaged tools, armor, or other items with durability by combining them in the grindstone.

Usage
Two items of the same type and material can be placed anywhere on the crafting grid, which will result in a single repaired item. The repaired item will have usage points equal to the sum of the old items' usage points plus a 'repair bonus' of 5% of the item's 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 will never be enchanted, even if both items were to have the exact same enchantments. Hence, given the current random enchantment system, using a 'junk' item in a repair may sometimes be useful for removing an unwanted enchantment from an item prior to trying to enchant it again. Tools made of different materials (for example, a wood and a stone pickaxe) cannot be combined.

Formula for uses restored
The formula for determining how many uses a repaired item will have restored to it in the crafting box, is as follows:

min( Item A uses + Item B uses + floor(Max uses / 20), Max uses)

'floor' means round down to the smaller integer, which rounds the (possibly fractional) 5% bonus. 'min(x,y)' means whichever of x or y is smallest, which effectively limits repairing result to "Max uses" (repair to 100%)

Example: Two stone axes have 10 and 45 uses. A newly crafted stone axe would have 132 uses.


 * 10 + 45 + 132/20 = 55 + 6.6 = 61

Or, in terms of percentage (approximated):


 * 7.5% + 34% + 5% = 46.5%

Thus, the greatest benefit is gained when the two items have a combined durability of at most approximately 95%. You can combine 47.5% + 47.5%, 94% + 1%, 10% + 10% or any other values that total 95% or less. The order in which items are combined does not matter; one sequence of repairs gives exactly the same durability as any other.

However, note in the example, repairing a stone tool restores a bonus of 6 durability, which is actually only 6/132 = 4.5%. The precise combined durability for efficient repairs is shown in the following table.

A good strategy is to wear down two items until both have less than 95% combined durability remaining, but are not so damaged that you risk accidentally breaking them. Put each item in a crafting slot, and check whether the resulting repaired item still has a damage bar. If it does, you can be sure of gaining the full 5% repair bonus for combining those two items, and if it does not, you will lose some of the repair bonus. (A 'perfect' repair is theoretically possible, but unlikely in practice.)

Note that combining items whose combined durability is more than 100% actually wastes more resources than simply using tools until they break.

The precise combined durability for efficient repairs for all types of armor is shown in the following table.

Anvil Repair
An anvil can also repair items in two different ways. This will cost experience levels, but unlike the crafting table, the anvil will preserve or even enhance the target's 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 only a summary is given here.

The first repair mode is similar to repairing in the crafting box, in that you combine two items of the same basic type, a "target" and a "sacrifice". The anvil's second repair mode applies only to those tools whose material is in their default name, such as an iron sword or leather helmet. That material is then used to repair the item. For example, to repair an iron sword, place the damaged sword and one or more iron ingots in the anvil.

Trivia

 * Working on an anvil doesn’t remove enchantments to items but they can be removed by repairing on a crafting grid and grindstone.