Anvil

An Anvil is a block that uses the item repair interface to repair and rename items, and combine enchantments. The anvil uses a complex XP cost system, where the way the tools are positioned and how many times they are repaired affect their cost. For full details, see the Anvil Mechanics page.

Usage
Anvils can be used to repair tools and armor, and rename items and blocks. Anvils are affected by gravity like sand, dragon eggs, gravel and ignited TNT. All their functions cost experience levels (more for enchanted items), and some have material costs as well.

Repairing and renaming
Anvils have two modes of repair. They can combine two items like the crafting grid, but the target will keep its enchantments, and may gain new ones from the sacrifice item! Anvils can also use "units" of material (iron ingots, wooden planks, pieces of leather, etc.) to repair tools and swords made of that material. On heavily damaged tools, more than one piece of material may be required; each represents 25% of the item's maximum durability. The player can also rename any item - not just tools or armor - using an anvil. (Renaming an item reduces a penalty paid for repairing the same item multiple times.) On each use, anvils have a 12% chance to be damaged. On its last use, the GUI will close and the anvil will disappear, dropping the item on the ground.

How To Repair
Use a damaged tool, place it to the left of the plus (+) sign. On the right, place either a matching item (enchanted or unenchanted), or one or more pieces of the item's material. The anvil will then tell you how many levels this repair will cost. Once finished, you will have a fully repaired item. This method gets more difficult as you go on to obtaining diamond tools. Repairing with materials only works for items with their material in the default name, e.g. Iron Pickaxe. Repairing with a matching item works for any item with durability, including bows, shears, and so on. The level costs for both sorts of repairing get very expensive for diamond items, and very expensive for heavily enchanted items.

As a subset of repairing one item with another, the anvil can transfer enchantments from the "sacrifice" item to the target. Two sharpness II swords can be combined to a sharpness III sword, or a pick with Efficiency can be combined with one that has Unbreaking. This can produce enchantments and combinations that could not be made at an enchanting table, but even so, some enchantments cannot be combined (such as Sharpness and Smite). Also, the items must match in type -- you cannot combine a golden pickaxe with an iron one. If the target is damaged, you will pay for the repair as well as the transfer. The anvil has a limit of 39 levels, beyond which it will refuse the repair altogether. (This limit is raised in creative mode.) For full details of the anvil's costs and restrictions, see the Anvil mechanics page.

Falling anvils
If there is no block below an anvil, it will fall. An anvil will make a metal-like sound when it falls.

When an anvil lands on a non-solid block (like torches, rails, etc.), it will destroy that item instead of dropping itself as an item like sand, gravel, and dragon eggs do. When dropped on a pressure plate, a boat, cobwebs, a slab, a sign, a cake, a lily pad, closed trapdoor or opened fence gate, the anvil will drop as an item. When dropped on a flower pot, the flower pot is destroyed without a drop. When dropped on a head, the head is dropped as an item.

A falling anvil will also damage mobs and players. Damage amount depends on fall distance: × MIN(Distance × 2, 10). Wearing a helmet will reduce the damage by 45%. A player dying by an anvil falling on them will receive this message: "player was squashed by a falling anvil." However if a player is touched by an anvil entity, or falling anvil, no damage will result until the anvil becomes a block in the gridspace where the player is. So anvils can be shot with a TNT Cannon, and pass right through a player, and not damage them.

An anvil has a chance to be damaged by the fall. Damage chance also depends on fall distance and is equal to (5 + Distance*5)%

Bugs

 * When anvils are dropped on a bed, you can still sleep on it.
 * If you drop an item from a renamed stack of items it will no longer stack, even with more items with the exact same name.
 * If you place a renamed block or give a renamed item to a zombie and then reclaim it, the block or item will lose its name.
 * Anvils can be pushed by pistons if the anvil is falling.
 * Bows and fishing rods cannot be repaired with either sticks or string.
 * An anvil will not fall if there is a vine under it.

Trivia

 * It takes a total of 31 iron ingots to craft an anvil.
 * Similarly to obsidian, bedrock and End Portal Frames, anvils cannot be pushed or pulled by pistons.
 * The anvil has the same blast resistance as obsidian and enchantment table.
 * If you rename a material, such as diamonds, it will not stack with unnamed or differently-named items.
 * An anvil will last about 25 uses.
 * Armor reduces amount of damage caused by falling anvil.
 * The high blast resistance and transparency of the block makes for a good blast-proof window.
 * If a falling anvil lands on a pressure plate, it will damage any mob standing on the pressure plate, and drop as an item without damaging itself.
 * It is more expensive to repair an item using an anvil than to make a new item, making it inefficient to repair unenchanted items. However, this is not true for all unenchanted items.
 * It will likely cost less to repair armor than what it costs to make new armor.
 * For most tools, however, crafting 2 together is more efficient than repairing both individually, since it costs about 2 or 3 ingots to repair an item with just half of its life left. (Considering the user has the XP to spare)
 * If placed on top of exploding TNT blocks, the explosion won't affect the surrounding area.
 * One will usually choose enchanting a new item with new effects over maintaining an already enchanted but damaged item, as they both will cost more or less the same amounts of XP
 * A good exception would be a tool with any level of Unbreaking, combined with another that has any other highly desirable enchantment. This eliminates the need for trying your chances for re-enchanting for the desired effect, as the tool will last several times its lifespan because of the now-added Unbreaking. (For example, a diamond pickaxe with Unbreaking level 3 combined with a diamond pickaxe with Efficiency 4 will result in a diamond pickaxe with Efficiency 4 that lasts three times its lifespan, saving the user about 60 levels of XP.)