Anvil mechanics/Before 1.8



This page explains the mechanics of the anvil. This page focuses on combining enchantments on tools, swords, armor and bows.

Combining and Repairing Items
An anvil can combine two items of the same type, merging their enchantments (within certain limits). This will cost experience levels depending on both the items put in, and the item that results. The tables below assume that the items are fully repaired; if they are damaged, it will cost more. Also, if an item has previously been combined, there will be an additional penalty. There is also a separate mechanism for repairing single items by adding more of their base material, but it's unclear whether this invokes the penalty.

This is for items in general for the anvil (doesn't depend which slot you put it in).


 * 1) The material that the tool is made out of doesn't matter. A wooden sword with looting 3 and bane 4 will cost the same when you put it into an anvil as a diamond sword with the same enchantments.
 * 2) Adding two like enchantments will give you an enchantment of the next level, as long as it doesn't go over the cap (knockback 1 + knockback 1 = knockback 2, but looting 3 + looting 3 = looting 3 still, since there is no looting 4)
 * 3) When combining enchantments, the item in the first slot (left slot) will be the "target", the item that gets the enchantment. This also means that if a sword with sharpness 3 and looting 2 is in the first slot, and a sword with bane 2 and looting 2 in the second slot, the sword with sharpness will override the bane sword, giving the final sword sharpness 3 and looting 3. It also means, though, that if the order of the swords are switched (i.e. have bane in first slot and sharpness in second), the final sword would end up having bane 2 and looting 3.
 * 4) Every time an item is put through the anvil, 2 extra levels are added to it. This means that if a sharpness 4 sword is made using two sharpness 3 swords, it will cost 2 more levels than a 'pure' sharpness 4 sword would.
 * 5) The maximum level of items that can be put into an anvil is 40. Once past this, the anvil says it is too expensive and won't do anything to it. In creative, the amount of levels on an anvil is more than normal.
 * 6) The costs are different for the target item and the one that's combined with it.  Putting the more powerfully enchanted of the two items into the first slot, will make the result cost less.
 * 7) The order of the enchantments on a weapon doesn't matter. A sword with sharpness 4, fire 2 and knockback 1 will cost the same as a sword with knockback 1, sharpness 4 and fire 2

Slot and other costs
The experience levels needed for a combination are the sum of various values:
 * 1) The "first slot" cost for each enchantment of the item in the first slot.  These vary with the level of the enchantment, with a base cost and a constant cost for each additional level.
 * 2) The "second slot" cost for each enchantment of the item in the second slot.  These costs are constant for each enchantment type, and a maxed-out enchantment costs half.
 * 3) A penalty for the number of enchantments on the first item.  That is 0 for a single enchantment, 1 for two, 3 for three, or 6 levels for 4 enchantments.
 * 4) An additional penalty of 2 levels for each time either item has been combined in an anvil.

Tables
Here are the tables for each item. The first column (left most column) gives the title of the enchant. The middle column gives the base cost of that enchant (that is, having an item with that enchant being in the first slot), while the right most column gives the value for an item with that enchant in the second slot.

Bows
To calculate the total cost of an item, add up the cost of each enchantment on it using the middle column, then add a value from this table based on how many extra enchantments it has (an item with only 1 enchant has no extra enchants on it, while an item with 4 enchants has 3 extra enchantments on it):

You can calculate the number of levels you need to add by finding the nth triangular number, where n is the amount of extra enchants on an item.

Note: Items marks with an (*) are ones that can not be gotten from an enchantment table (like sharpness 5). If one can get a pure enchantment like this, the values from the table (like 6 for sharpness 5) would be used, but since they have to be made, you have to add the amount of times it has been put in anvil before (see point 4 under section 'General Notes'). For example, to make a sharpness 5 using 2 pure sharpness 4 swords would cost 7 levels. If that sword is then put that into an anvil, instead of costing 6 levels for a pure sharpness 5 sword, it will cost 2 more levels than that, so 8 levels total. This means that for sharpness, efficiency and power 5, the minimum level in the anvil will be 8. This is the same for the items in the third column of the table

Example
Say we make a sword with sharpness 3, knockback 2 and looting 2. To calculate the level it will be when going into the anvil, one must use the tables from the first slot section. The base cost of sharpness 3 is 4, the base cost of knockback 2 is 5 and the base cost of looting 2 is 9. This sword has 2 extra enchantments on it, so by looking at the table above for the extra enchantments, it can be seen that we need to add an extra 3 levels to the cost. This means that when this sword is put it into the anvil, it should cost 4+5+9+3=21 levels. If another sword is then enchanted and gets sharpness 3 and looting 2 on it, these two items can be combined to get a sword with sharpness 4, looting 3 and knockback 2. To calculate how much this would cost, we need to look at the tables in the second slot section. To add sharpness 3 costs 2 levels, and to add looting 2 costs 8 levels. This means, that if the first sword is in the first slot, thus starting with the 21 levels from before, to add the sharpness 4 and looting 2 sword would cost 21+2+8=31 levels.

First sword in anvil. It costs 21 levels, as predicted



Second sword in the anvil



Final sword costing the amount predicted, with the enchantments predicted



铁砧机制