Enchanting



Enchanting is a game mechanic that involves using an Enchantment Table to add special bonuses to tools, weapons or armor. To enchant an item, you need the required Experience level for the enchantment and an Enchantment Table. Each spell costs the player experience levels but in turn allows the player to enchant armor, swords and tools with one or several random bonus attributes as well as making the items glow with a brilliant hue.

Enchanting basics
To enchant an item, craft an Enchantment Table, place it on the ground, right-click on it and drag an enchantable item from your inventory onto the square under the book icon. Three randomly chosen enchantments will appear on the menu on the right. The only thing you can know for sure about them is their level, which appears as a number; the foreign text is random. You can take the item off and place it on the table again for a different set of enchantments. Or, you can attempt to replace the item on the table with a stack of two or more of any other item from your inventory.

Once you choose an enchantment, it will be applied to your item, giving it a glow and one of the special powers detailed below, and you will lose a number of experience levels equal to the level of the enchantment. Enchantments cannot be undone (unless you repair the item, which removes enchantments) and an item can only be enchanted once (although you may receive multiple enchantments during one instance of enchanting, determined randomly).

Whenever you place an eligible item on the table, the enchantment levels available are randomly generated for each slot using the formula below. The enchantment level is dependent upon the number of nearby bookshelves (capped at 30) and a "slot factor" of 0.50 for the topmost enchantment slot, 0.66 for the middle slot, and 1.00 for the bottom slot. (If the number of bookshelves is 0, the second two random integers will always be zero. When placing bookshelves around the Enchanting Table they CANNOT be touching the table or the table will not change from 5.


 * Enchantment level available = (1..5 + 0..(b/2) + 0..b) &times; s,

where b is the number of nearby bookshelves (maximum of 30), s is the slot factor for the given enchantment slot, and x..y generates a random integer between x and y inclusive. (Note that however many bookshelves are being used, 1 is still available as the lowest level.)

Bookshelf placement
Nearby bookshelves raise the available enchantment levels. As of Beta 1.9 Pre-release 4, no enchantments costing above five Experience levels are available unless you place bookshelves near but not touching the Enchantment Table. In order to have an effect, a bookshelf must be placed exactly 2 blocks, laterally, of the enchantment table and be on the same level or one block height above the table, and the space between the bookshelf and table must be Air (even a torch will block the effect), where “between” is as shown in the following diagrams:

An enchantment table can be surrounded by 30 bookshelves by placing them in a square around the table, with each wall measuring 5 blocks wide and 2 blocks high, with a 2 block high doorway. This arrangement gives the maximum possible boost. (While it is possible to get two more bookshelves in "range", they do not add, as the boost is capped.)

Enchantments
Enchantment names are randomly constructed from a long list of words. Three to five words are chosen from the list and appended to each other, creating the enchantment name. Any name can be chosen for any item. Note that the names are not actually saved with the item, they are only displayed in the Enchantment Table interface, albeit with the Standard Galactic Alphabet.

"scrolls klaatu berata niktu xyzzy bless curse light darkness fire air earth water hot dry cold wet elder ignite snuff embiggen twist shorten stretch fiddle destroy imbue galvanize enchant free limited range of towards inside sphere cube self other ball mental physical grow shrink demon elemental spirit animal creature beast humanoid undead fresh stale"

Repairing an enchanted weapon/tool will remove the enchantment on it.

When an enchanted weapon deals bonus damage to a mob, circular blue particles fly off of that mob, similar to getting a critical hit.

There are several levels on most enchants, and when you enchant you can get several enchants on each weapon/tool/armor.

Enchantable Items
Items such as swords, shovels, pickaxes, axes, and every part of armor of any material can be enchanted. Hoes, shears, fishing rods, bows and flint and steel are not enchantable.

Enchantment Types
EID is the item's Effect Identification Number in the game code.

{| class="wikitable" style="text-align: center;" ! EID ! style="width: 15em;" |Enchantable item ! Name ! Effect ! Max. Enchantment Power ! On level up ! Notes ! colspan=7 |

Armor Enchantments
! 0 ! 1 ! 2 ! 3 ! 4 ! 5 ! 6
 * - align="center"
 * Protection
 * Converts environmental damage to armor damage
 * IV
 * Armor with this enchantment cannot receive any other type of Protection
 * - align="center"
 * Armor with this enchantment cannot receive any other type of Protection
 * - align="center"
 * Fire Protection
 * Protection against fire
 * IV
 * Armor with this enchantment cannot receive any other type of Protection
 * - align="center"
 * Armor with this enchantment cannot receive any other type of Protection
 * - align="center"
 * Feather Falling
 * Feather Falling
 * Less fall damage
 * IV
 * +1 to reduction of falling damage (half a heart)
 * - align="center"
 * - align="center"
 * Blast Protection
 * Protection against explosions
 * IV
 * Armor with this enchantment cannot receive any other type of Protection
 * - align="center"
 * Armor with this enchantment cannot receive any other type of Protection
 * - align="center"
 * Projectile Protection
 * Protection against projectile entities (e.g. arrows)
 * IV
 * Armor with this enchantment cannot receive any other type of Protection
 * - align="center"
 * Armor with this enchantment cannot receive any other type of Protection
 * - align="center"
 * Respiration
 * Respiration
 * Decreases the rate of air loss underwater; increases time between damage while suffocating
 * III
 * Underwater breathing time +15 seconds; time between suffocation damage +1 second
 * - align="center"
 * - align="center"
 * Aqua Affinity
 * Aqua Affinity

! colspan=7 |
 * Increases underwater mining rate
 * I

Weapon Enchantments
! 16 ! 17 ! 18 ! 19 ! 20 ! 21 ! colspan=7 |
 * - align="center"
 * Sharpness
 * Extra damage
 * V
 * Up to 1.5 hearts extra damage per level
 * Extra damage is random for every hit, but will always be at least 0.5 heart. A Sword with this enchantment cannot receive Smite or Bane of Arthropods.
 * - align="center"
 * - align="center"
 * Smite
 * Extra damage to zombies, zombie pigmen and skeletons
 * V
 * Up to 2 hearts extra damage per level
 * Extra damage is random for every hit, but will always be at least 0.5 heart. A Sword with this enchantment cannot receive Sharpness or Bane of Arthropods.
 * - align="center"
 * - align="center"
 * Bane of Arthropods
 * Extra damage to spiders, cave spiders and silverfish
 * V
 * Up to 2 hearts extra damage per level
 * Extra damage is random for every hit, but will always be at least 0.5 heart. A Sword with this enchantment cannot receive Sharpness or Smite.
 * - align="center"
 * - align="center"
 * Knockback
 * Knocks mobs and players backwards upon hit
 * II
 * Does not stack with knockback caused by attacking while sprinting.
 * - align="center"
 * Does not stack with knockback caused by attacking while sprinting.
 * - align="center"
 * Fire Aspect
 * Fire Aspect
 * Lights mobs on fire
 * II
 * 0.5 heart extra damage per second
 * Will cook meat if mob is killed by the fire damage
 * - align="center"
 * Looting
 * Mobs have a chance to drop more loot
 * III
 * +1 to max loot drop per level
 * +1 to max loot drop per level

Tool Enchantments
! 32 ! 33 ! 34 ! 35
 * - align="center"
 * Efficiency
 * Faster resource gathering while in use
 * V
 * +10% mining speed
 * Most blocks break instantly at levels IV and V.
 * - align="center"
 * - align="center"
 * - align="center"
 * Silk Touch
 * Silk Touch
 * Blocks mined will drop themselves, even if it should drop something else (e.g. stone will drop stone, not cobblestone)
 * I
 * Allows the collection of normally unobtainable blocks such as Ores, Mycelium, Double Slabs and Huge Mushrooms. (Regardless of the tool used as of 1.0)
 * - align="center"
 * - align="center"
 * Unbreaking
 * At each use, there's a chance the tool's durability will not decrease.
 * III
 * For example, an Unbreaking III item has a chance to use up a use of 100/(3+1)% = 100/4% = 25%, so Unbreaking III should, on average, make a tool last 4 times as long.
 * - align="center"
 * For example, an Unbreaking III item has a chance to use up a use of 100/(3+1)% = 100/4% = 25%, so Unbreaking III should, on average, make a tool last 4 times as long.
 * - align="center"
 * Fortune
 * Fortune
 * Can multiply the drop rate of items from blocks
 * III
 * I: 30% * 2 (30% more)

II: 25% * 2, 25% * 3 (75% more)

III: 20% * 2, 20% * 3, 20% * 4 (120% more)


 * Only applies to item drops such as coal, diamond, redstone, glowstone, lapis lazuli and nether wart. When used on Wheat, only the Seeds' drop rate is affected. When used on a Melon Block, the drop rate of melon slices are increased. Increases the chance for Gravel to drop Flint instead of itself, up to 100% at III. It doesn't affect clay ball drop rates (it is always 4).
 * }

How Enchantments Are Chosen
"Enchantment level" is the cost of the enchantment in experience levels (the green number on the button). "Enchantment power" is the strength of the particular enchantment. For example, "Sharpness IV" has power 4. The enchantment algorithm uses a three-step process.

Step One - Applying modifiers to the enchantment level
The first thing that Minecraft does is apply two modifiers to the base enchantment level. Each modifier is restricted to a certain range, with numbers close to the middle of the range more common than those near the ends.

The first modifier is based on the item's "enchantability," which depends on the material and the type of the item (see the table below). Minecraft picks a number between 0 and the enchantability, then adds that number plus one to the enchantment level.

Next, Minecraft picks a value between 0.75 and 1.25. The modified enchantment level is multiplied by this value (so it could increase or decrease by up to 25%) and then rounded to the nearest integer.

Step Two - Find possible enchantments


Now, based on the modified level, Minecraft makes a list of all enchantment types that can be applied to the target item along with the power that each enchantment will have.

The power of each enchantment type is determined by the level and the values in the table below. For each power value of an enchantment type, there is a minimum and maximum level that can produce the enchantment at that power. If the modified enchantment level is within the range, then the enchantment will be assigned that power. If the level is within two overlapping ranges for the same enchantment type, the higher power value is used.

Note: that extremely high modified enchantment levels can fall outside the ranges of all valid enchantments for the item. If this happens, the item is left un-enchanted, but you are not charged any experience levels and can try enchanting it again.

Step Three - Select a set of enchantments from the list
Now that it's got a list of the possible enchantments for the item, Minecraft has to pick some of them that will actually be applied.

You always get at least one enchantment. The first enchantment is picked from a list of statistical "weights" - the enchantment with the higher weight has a higher chance of being selected.

After the first element is selected, there is a chance of receiving more, based on this algorithm:


 * 1) Divide the modified level in half, rounded down. (This does not affect the possible enchantments themselves, because they were all pre-calculated in Step Two.)
 * 2) With probability (modified level + 1) / 50, keep going. Otherwise, stop picking bonus enchantments.
 * 3) Remove from the list of possible enchantments anything that conflicts with previously-chosen enchantments.
 * 4) Pick one enchantment from the remaining possible enchantments (based on the weights, as before) and apply it to the item.
 * 5) Repeat from step 1.

Conflicting Enchantments
Some enchantment conflict with other enchantments and thus both can't be enchanted into the same item, Effectively taking down the possibility for one to get an overpowered weapon.

The rules for enchantment conflicts are:
 * Every enchantment conflicts with itself. (So you can't get a tool with two copies of the Efficiency enchantment.)
 * All protection enchantments conflict with each other, so an item can only have one at a time. (In the code, Feather Fall is implemented as a protection enchantment, but it doesn't conflict with the others.)
 * All damage enchantments (Sharpness, Smite, and Bane of Arthropods) conflict with each other.
 * Silk Touch and Fortune also conflict with each other. (The Fortune enchantment has no effect on a pickaxe that also has Silk Touch, such as could be obtained in a 1.9 prerelease or with an inventory editor, since a Silk Touch pickaxe cannot mine resources such as diamonds or coal -- only their ore blocks.)

Examples

 * A level 50 diamond pickaxe would have a 16.10% chance to have 3 enchantments, a 48.09% chance to have exactly 2 enchantments and a 35.80% chance to have exactly 1 enchantment. The resulting enchantments would have a 75.43% chance to include Efficiency (9.26% for 3, 39.97% for 4 and 26.21% for 5), a 54.85% chance to include Unbreaking 3, a 28.88% chance to include Fortune (27.22% for 3 and 1.66% for 2) and a 15.06% chance to include Silk Touch 1.
 * A level 30 iron pickaxe would have a 6.34% chance to have 3 enchantments, a 34.65% chance to have exactly 2 enchantments and a 59.00% chance to have exactly 1 enchantment. The resulting enchantments would have a 68.08% chance to include Efficiency (22.60% for 2, 41.59% for 3 and 3.89% chance for 4), a 65.53% chance to include Unbreaking (57.98% for 2, 7.55% for 3), a 21.05% chance to include Fortune (5.36% for 1, 13.08% for 2, 2.60% for 3) and a 10.72% chance to include Silk Touch 1.
 * A level 1 stone pickaxe would have a 0.23% chance to have 3 enchantments, a 6.04% chance to have exactly 2 enchantments and a 93.73% chance to have exactly 1 enchantment. The resulting enchantments would have a 84.84% chance to include Efficiency 1 and a 18.86% chance to include Unbreaking 1.
 * A level 50 diamond helmet would have a 0.28% chance to have 3 enchantments, a 35.03% chance to have exactly 2 enchantments and a 64.70% chance to have exactly 1 enchantment. The resulting enchantments would have a 83.09% chance to include Protection (16.66% for 3 and 66.43% for 4), a 5.05% chance to include Fire Protection (0.02% for 3 and 5.03% for 4), a 38.33% chance to include Respiration 3, a 0.96% chance to include Aqua Affinity 1 and a 0.32% chance to include Blast Protection 4.  It would also have a 6.65% chance of being left "un-enchanted" (see note above).
 * A level 37 diamond helmet would have a 0.32% chance to have 3 enchantments, a 37.05% chance to have exactly 2 enchantments and a 62.63% chance to have exactly 1 enchantment. The resulting enchantments would have a 64.44% chance to include Protection (2.37% for 2, 40.93% for 3 and 21.14% for 4), a 17.59% chance to include Fire Protection (6.65% for 3 and 10.93% for 4), a 43.00% chance to include Respiration (0.12% for 2 and 42.88% for 3), a 11.66% chance to include Aqua Affinity 1, a 4.55% chance to include Blast Protection 4 and a 1.84% chance to include Projectile Protection 4.

How Enchantments Are Attached to an Item
The Enchantments of an item are determined by an extra set of data attached to the item.

The extra data is a "compound" labeled "tag"; Which contains a "list" of data named "ench"; in which is a series of "compound"[s] (one compound for each enchantment); Each of the "compound"[s] contains a pair of "short"[s] named "id" and "lvl";

The "id" short represents the EID of the enchantment and the "lvl" short represents the level of the enchantment.

Hacking Enchantments
It is possible to edit enchantments via an external program such as NBTEdit by using a process such as that shown here.

Standard Galactic Alphabet
The enchantments are written in the Standard Galactic Alphabet which is a simple alphabet substitution code used in the Commander Keen series of computer games (see that page for the code key). However, if you want to decode the names more quickly you can replace  in   (or in   for OSX,   for linux) with the   NOTE: this does not work if you're using a texture pack.

There is something that may help you decode the language: Note: Decoding the alphabet will allow a player to read the enchantment phrases in his or her native language, although these phrases remain arbitrary, as of client version 1.0.0.

History
Notch first tweeted about the Enchantment Table on September 30th 2011. Not03746376089600]]

Enchanting was added to the game in 1.9 prerelease 2. However, enchanting was not the same in the 1.9 prerelease 2. Enchanting did NOT require bookshelves to get maximum enchantments. Also, many enchantmended back then. Enchantments are labeled in the enchanting table as random words in the Standard Galactic Alpha

Bugs

 * Using the "Silk Touch" enchantment, it is possible to obtain either Redstone Ore or Glowing Redstone Ore, depending on the block's state when broken. These are different blocks and do not stack, but appear to be identical in the user's inventory.
 * Sometimes, logging off a server with an enchanted tool on you, will remove the enchantments from the item.
 * In multiplayer, players can only see their own enchantment auras, and not those of other players.