Item repair



Item Repair is a feature that allows players to repair damaged tools, armor, or other items with durability by combining them on a crafting grid. Two items of the same type and material can be placed anywhere on the crafting grid, and the result is 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% (10% before 1.4) of the item's maximum uses, up to a limit of the maximum durability for that item.

Even if both items were enchanted with exactly the same enchantments, the repaired object will always be unenchanted. 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.

Repairing gives a slight benefit in conserving inventory space, as it combines two non-stackable objects into one, and the ~5% 'repair bonus' allows you to get slightly more total uses out of tools, which helps eke out resources a little further.

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( floor( Item A uses + Item B uses + (Max uses / 20) ), Max uses)

('floor' means round down to the nearest integer, 'min(a,b)' means whichever of a or b is smallest.)

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

This algorithm gives the greatest benefit when the two items have an average durability of at most 47.5%. You can combine 47.5% + 47.5%, 94% + 1%, 1% + 1% 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.

A good strategy is to wear down two items until both have less than 47.5% 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 average durability is more than 50% actually wastes more resources than simply using tools until they break.

Anvil Repair
An Anvil (introduced in version 1.4.2) can also repair items in two different ways. This will cost experience levels, but unlike the crafting box, 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.

When working on items in an anvil, you pay levels equal to the target's "base value" up front, which depends on the enchantments it has, but not on its material or durability. An unenchanted item has base value 0. You may also pay a surcharge if the item has previously been repaired or renamed -- if it has been renamed, the charge is always 2 levels, but if it has not, it is 2 levels for each prior repair. After this come costs that vary according to what you're trying to do. If the cost would exceed 39 levels, the anvil will refuse the job, declaring it "too expensive". (This limit is lifted in creative mode.)

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". These can be any item with durability, including such things as shears, but the items must match -- you can't repair a gold chestplate with an iron one. The resulting durability will be the sum of the two item's durability, plus a bonus of 12% of the type's maximum durability. If the sacrifice is unenchanted, this will be relatively cheap for most items, costing one or two levels on top of the base value and prior-work charge. However, bows and diamond armor can cost up to 5 levels, and diamond tools up to 17. The exact cost depends on the durability of the sacrifice item, as well as the maximum durability for its type.

If the sacrifice is enchanted, some or all of its enchantments can be transferred to the target, at various additional costs. There are restrictions: You are charged for each enchantment transferred, and some cases where it wasn't. If you are also repairing the target, the costs combine, but you only pay the base value and prior-work penalties once.
 * Some groups of enchantments are incompatible -- for example, you can't add Smite to a Sharpness sword. However, it does cost something if you try to!
 * If the target lacks that enchantment or has a weaker version, it gains the enchantment at the sacrifice's level. You pay according to the type of enchantment and number of levels gained.
 * If the target and sacrifice have it at equal levels, the target gains one level (unless they are already at the maximum level). Even if it's maxed out, you pay something for this case.
 * If the target already has a higher level, it is unchanged. (No cost.)

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. To use this mode, you put the item to be repaired in the first slot, but in the second slot you put units of the item's material -- e.g, iron ingots for iron tools/armor or pieces of leather for leather armor. In addition, it is possible to repair rare chainmail armor using iron ingots in the second slot. Each unit can repair up to 25% of the item's maximum durability. The cost is the item's base value, plus a per-unit cost. Using multiple units costs more up front, but it saves in the long run, since you pay the base value each time you put the item in the anvil. For most items, the unit cost is the number of enchantments on the item, plus 1. Diamond tools and swords are more expensive -- above the number of enchantments, you pay 3 more per diamond used. However, you can get a bargain on the last or only diamond, if it didn't have much to repair.