Bookshelves increase the level of enchantments you can put on your items. For instance, without any bookshelves, you can only use enchantments from around levels 1-5. However, if you add more bookcases, you can use higher level enchantments. A table with 6 bookshelves will allow level 14 recipes. A table with 30 shelves will let you use level 50 recipes. Show
Enchantments have levels, and these levels are drawn from your current XP level. For instance, purchasing a level 5 enchantment will bring you down 5 levels. However if you do not have five levels, then you cannot buy the enchantment. Link to table of enchantments and their levels This article is about the mechanics of enchanting. Basic mechanics[]Whenever the player places an eligible item on the enchanting 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 15) and which slot position it is in. Base enchantment level available (base) = (randomInt(1,8) + floor(b / 2) + randomInt(0,b)),where b is the number of nearby bookshelves (maximum of 15) and x..y generates a uniformly distributed random integer between x and y, inclusive. This is then modified according to the slot position: Top slot enchantment level = floor(max(base / 3, 1)) Middle slot enchantment level = floor((base × 2) / 3 + 1) Bottom slot enchantment level = floor(max(base, b × 2))where max(x, y) returns the greater of two values x and y.
Note that a higher experience cost for a specific slot does not necessarily mean that the enchantments from that slot are better than the others with less cost. In Creative mode, no levels of experience are necessary for enchantments. Bookshelf placement[]Nearby bookshelves raise the available enchantment levels; without any bookshelves, the experience level requirement never exceeds 8. In order to have an effect, a bookshelf must be placed exactly 2 blocks, laterally, off the enchanting table and be on the same level or one block height above the table. Additionally, the bookshelf must not be blocked. The meaning of "blocked" differs on Java Edition and Bedrock Edition. Bedrock Edition[]The 2-high space between the bookshelf and table must be air (even a torch, snow cover or carpet blocks the effect), where "between" is as shown in the following diagrams (the white spaces are air, and the do not matter):
Java Edition[]The space between the bookshelf and table, at the height of the bookshelf must be air (even a torch, snow cover or carpet blocks the effect). For corner bookshelves, the space between is 1 block diagonal from the enchanting table; for all other bookshelves, the gap must be to the side of the enchanting table. This is illustrated in the following diagrams (the white spaces are air, and the do not matter):
The glyph particles, which fly from bookshelves, follow different rules and may appear even if the bookshelves are not enhancing the table. There are many possible bookshelf arrangements that can reach the enchantment limit. A simple method is to surround the enchanting table with a 1-block high square of bookshelves with an empty space anywhere on the perimeter: Another alternative that is now available is to build a 'library corner' where each bookshelf is two blocks high, as in the plan below. This arrangement gives space for 16 shelves, which is one more than needed, so if the corner bookshelf column cannot be seen, removing one of the two bookshelves in that does not have any effect, either technically or visually. Selecting an enchantment level[]As enchantments offered depend on the enchantment level and the enchantment level depends on the number of active bookshelves, an easy way to change the enchantments offered is to disable bookshelves by placing torches between them and the enchanting table. That way one can still have the entire 'ring' of bookshelves around the table but get lower-level enchantments. Breaking the torches restores the effect of the bookshelves. Bedrock Edition[]With the layout shown here, enchantments with any number of bookshelves from 0 to 15 may be easily obtained:
Java Edition[]With the layout shown here, enchantments with any number of bookshelves from 0 to 15 may be easily obtained:
How enchantments are chosen[]"Enchantment level" is the required experience level (the green number on the bottom-right). "Enchantment power" is the strength of the particular enchantment. For example, "Sharpness IV" has a power of 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). Other enchantable items such as books, bows, crossbows, tridents, and fishing rods have an enchantability of 1 for this purpose. Minecraft picks a number between 0 and half the enchantability, then adds that number plus one to the enchantment level. This random value follows a triangular distribution (like rolling a pair of dice and adding) so results close to a quarter of the enchantability are much more likely than results at the extremes. The modified enchantment level is calculated with the following formula: Modified enchantment level = B + R1 + R2 + 1Where:
Division is rounded down. Enchantability[]
Next, Minecraft picks a value between 0.85 and 1.15, again with a triangular distribution. The modified enchantment level is multiplied by this value (so it could increase or decrease by up to 15%) and then rounded to the nearest integer. Step 1 pseudocode[]// Returns a uniformly distributed random integer between 0 and n–1, inclusive function randomInt(n); // Returns a uniformly distributed random real (fractional) number between 0 (inclusive) and 1 (exclusive) function randomFloat(); // Returns the real number n rounded to the nearest integer. function round(n); // Generate a random number between 1 and 1+(enchantability/2), with a triangular distribution int rand_enchantability = 1 + randomInt(enchantability / 4 + 1) + randomInt(enchantability / 4 + 1); // Choose the enchantment level int k = chosen_enchantment_level + rand_enchantability; // A random bonus, between .85 and 1.15 float rand_bonus_percent = 1 + (randomFloat() + randomFloat() - 1) * 0.15; // Finally, we calculate the level int final_level = round(k * rand_bonus_percent); if ( final_level < 1 ) final_level = 1The source is Minecraft 1.8 source code. Step two – Find possible enchantments[]A sword with several 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 has. The power of each enchantment type is determined by the level and the values in the enchantments levels table. For each power value of an enchantment type, there is a minimum and maximum modified level that can produce the enchantment at that power. If the modified enchantment level (calculated at the first step) is within the range of an enchantment's possible power values, then the enchantment is assigned the modified enchantment level as power. If the modified level is within two overlapping ranges for the same enchantment type, the higher power value is used. Treasure[]Some enchantments are "treasure enchantments" (shown in the table below), meaning they can never be created by an enchanting table, and can be discovered only in certain situations: when generating chest loot (equipment and books), when fishing, when generating enchanted book trades, when bartering, and when an enchanted book is dropped by a raiding illager.[Bedrock Edition only] Step three – Select a set of enchantments from the list[]Now that it has a list of the possible enchantments for the item, Minecraft must pick some of them to apply. Each enchantment has a statistical "weight". Enchantments with higher weights have a higher chance of being selected. Minecraft uses the following weighted random selection algorithm:
This algorithm produces the same results as listing each enchantment the number of times given by its weight, then choosing a random entry from the combined list. So, for each enchantment in the list, the probability of it being selected is: Where:
Shields can be given the enchantments Unbreaking, Mending, Curse of Vanishing, and Curse of Binding by using Enchanted Books. The player always gets at least one enchantment on an item, and there is a chance of receiving more. Additional enchantments are chosen by this algorithm:
When enchanting books using an enchanting table, if multiple enchantments were generated, then one selected at random is removed from the final list. This does not apply to other sources of enchanted books that use enchantment mechanics, such as fishing or chests in generated structures. Conflicting enchantments[]Some enchantments 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:
Conflicting enchantments may appear on an item with specially-crafted /give commands. The behavior of such items should not be relied upon, but in general:
A chart showing all possible enchantments on diamond tools.[needs updating] Trivia[]
History[]
References[]External links[]
|