VOOZH about

URL: https://minecraft.wiki/w/Enchantment_mechanics

⇱ Enchanting table mechanics – Minecraft Wiki


Enchanting table mechanics

From Minecraft Wiki
(Redirected from Enchantment mechanics)
Jump to navigation Jump to search
👁 Image

This article is about the mechanics of enchanting with enchanting tables.

Basic mechanics

[edit | edit source]

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 randomInt(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.

# of bookshelves 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Min level (in top slot) 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2
Max level (in bottom slot) 8 9 11 12 14 15 17 18 20 21 23 24 26 27 29 30
# of bookshelves 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Level range of top slot 1–2 1–3 1–3 1–4 1–4 1–5 1–5 1–6 1–6 1–7 2–7 2–8 2–8 2–9 2–9 2–10
Level range of middle slot 1–6 1–7 2–8 2–9 3–10 3–11 3–12 3–13 4–14 4–15 5–16 5–17 5–18 5–19 6–20 6–21
Level range of bottom slot 1–8 2–9 4–11 6–12 8–14 10–15 12–17 14–18 16–20 18–21 20–23 22–24 24–26 26–27 28–29 30

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 experience or lapis is needed.

Bookshelf placement

[edit | edit source]

Nearby bookshelves raise the available enchantment levels; without any bookshelves, the experience level requirement never exceeds 8. The maximum number of bookshelves affecting enchantment level is 15.

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 in both Java and Bedrock editions.

Bedrock Edition

[edit | edit source]

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 blank spaces are air, and the 👁 BlockSprite beacon-revision-1.png: Sprite image for beacon-revision-1 in Minecraft
do not matter):

Like this from the top: or
and like this from the side: or

Java Edition

[edit | edit source]

The space between the bookshelf and table at the height of the bookshelf must be air or a replaceable block like snow or grass. 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 blank spaces are air, and the 👁 BlockSprite beacon-revision-1.png: Sprite image for beacon-revision-1 in Minecraft
do not matter):

Like this from the top: or
and like this from the side: or

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:

👁 Image
👁 Image
👁 Image
👁 Image
👁 Image
👁 Image
👁 Image
👁 Image
👁 Image
👁 Image
👁 Image
👁 Image
👁 Image
👁 Image
👁 Image
👁 Image

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.

👁 Image
👁 Image
👁 Image
👁 Image
👁 Image
👁 BlockSprite beacon-revision-1.png: Sprite image for beacon-revision-1 in Minecraft
👁 Image
👁 BlockSprite beacon-revision-1.png: Sprite image for beacon-revision-1 in Minecraft
👁 Image
👁 Image
👁 BlockSprite beacon-revision-1.png: Sprite image for beacon-revision-1 in Minecraft
👁 Image
👁 BlockSprite beacon-revision-1.png: Sprite image for beacon-revision-1 in Minecraft
👁 BlockSprite beacon-revision-1.png: Sprite image for beacon-revision-1 in Minecraft
👁 BlockSprite beacon-revision-1.png: Sprite image for beacon-revision-1 in Minecraft
👁 BlockSprite beacon-revision-1.png: Sprite image for beacon-revision-1 in Minecraft
👁 BlockSprite beacon-revision-1.png: Sprite image for beacon-revision-1 in Minecraft

Selecting an enchantment level

[edit | edit source]

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

[edit | edit source]
👁 Image

With the layout shown here, enchantments with any number of bookshelves from 0 to 15 may be easily obtained:

👁 BlockSprite black-wool.png: Sprite image for black-wool in Minecraft
👁 BlockSprite blue-wool.png: Sprite image for blue-wool in Minecraft
👁 BlockSprite red-wool.png: Sprite image for red-wool in Minecraft
👁 BlockSprite white-wool.png: Sprite image for white-wool in Minecraft
Active bookshelves
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
0
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
1
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
2
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
3
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
4
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
5
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
6
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
7
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
8
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
9
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
10
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
11
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
12
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
13
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
14
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
15

Java Edition

[edit | edit source]
👁 Image

With the layout shown here, enchantments with any number of bookshelves from 0 to 15 may be easily obtained:

👁 BlockSprite black-wool.png: Sprite image for black-wool in Minecraft
👁 BlockSprite blue-wool.png: Sprite image for blue-wool in Minecraft
👁 BlockSprite red-wool.png: Sprite image for red-wool in Minecraft
Active bookshelves
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
0
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
1
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
2
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
3
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
4
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
5
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
6
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
7
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
8
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
9
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
10
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
11
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
12
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
13
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite torch.png: Sprite image for torch in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
14
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
👁 BlockSprite air.png: Sprite image for air in Minecraft
15

How enchantments are chosen

[edit | edit source]

"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

[edit | edit source]

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.

Enchantability

[edit | edit source]

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. In Java Edition, an item's enchantability is stored in the minecraft:enchantable item component and can be changed with commands. 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.

👁 Image
For a list of which enchantments can be obtained through enchanting, see  § List of enchantments.
Material/Item Enchantability Armor enchantability (if different)
👁 Image
Book

👁 Image
Bow

👁 Image
Crossbow

👁 Image
Fishing Rod

👁 Image
Trident
1
👁 Image
Stone
5
👁 Image
Turtle Shell
9
👁 Image
Diamond
10
👁 ItemSprite chainmail-chestplate.png: Sprite image for chainmail-chestplate in Minecraft
Chainmail
12
👁 Image
Copper
13 8
👁 Image
Iron
14 9
👁 Image
Wooden

👁 Image
Leather

👁 Image
Netherite

👁 Image
Mace
15
👁 Image
Golden
22 25

The modified enchantment level is calculated with the following formula:

Modified enchantment level = B + R1 + R2 + 1

Where:

  • R1 and R2 are two individual randomly generated integers:
    • R1 = a random integer between 0, and E4 (rounded down)
    • R2 = a random integer between 0, and E4 (rounded down)
  • B is the base enchantment level.
  • E is the enchantability of the item.

See pseudocode below.

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 one pseudocode

[edit | edit source]
// 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((float)k * rand_bonus_percent);
if ( final_level < 1 ) final_level = 1;

This pseudocode is based on Minecraft 1.8 source code, but still matches the 1.21 behavior. Note that all operations not explicitly executed as floating-point calculations round their result down to the nearest integer, e.g. 3 / 4 becomes 0. The round method used to calculate the final level rounds values both ways, i.e. below .5 it rounds down and at or above .5 it rounds up.

A modified experience level probability calculator based on the pseudocode above can be found in this Desmos graph: https://www.desmos.com/calculator/iyvmjs3qfw.

Affecting offered enchantments

[edit | edit source]

Enchanting any item at any enchantment level changes the player's enchantment seed, which changes the possible enchantments for every item at every enchantment level (since the random number generating functions above are actually pseudorandom). Thus, if none of the available enchantments for a tool are desired, 1 lapis lazuli and 1 level could be spent to enchant a book or a different tool to refresh the list.

The possible enchantments depend on the player's enchantment seed, the item type, and material, and the enchantment level (1–30). The following actions do not affect the possible enchantments:

  • removing the item and putting it back in
  • clicking on the item slot with a different item
  • using a different item of the same type and material
  • replacing or moving the table (but keeping the same number of bookshelves)
  • using a different table with the same number of bookshelves, or
  • replacing or rearranging the bookshelves without changing their total number.

Changing the enchantment levels offered by adding, removing, or blocking bookshelves alters the enchantments shown, but does not change possible enchantments; using another enchanting table with the previous bookshelf number still shows the previous enchantments. The enchantments for a particular enchantment level (with the same seed and item) do also differ depending on which row they appear in, but they are not "better" or "worse" based on the row despite the different resource costs.

Step two – Find possible enchantments

[edit | edit source]
👁 Image
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

[edit | edit source]

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

[edit | edit source]

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:

  1. Calculate the total weight of all enchantments in the list (T). The total of every enchantment is 146.
  2. Pick a random integer from 0 to T – 1 as a number w.
  3. Iterate through each enchantment in the list, subtracting its weight from w. If w is now negative, select the current enchantment.

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:

P = w/T
Where:
  • w is the enchantment's weight.
  • T is the total weight of all enchantments in the list.

List of enchantments

[edit | edit source]
👁 Image
For a summary of all enchantments in the game, see Enchanting § Summary of enchantments.

The following table lists every enchantment that can be obtained from an enchanting table.

Item type Total weight Mutual exclusivity Enchantment Weight Maximum level
Armor
Helmet
Chestplate
Leggings
Boots
28 with each other Protection 10 IV
Fire Protection 5 IV
Projectile Protection 5 IV
Blast Protection 2 IV
Thorns 1 III
Unbreaking 5 III
Boots 35 Feather Falling 5 IV
with Frost Walker Depth Strider 2 III
Helmet 32 Aqua Affinity 2 I
Respiration 2 III
Sword 36 with each other Sharpness 10 V
Bane of Arthropods 5 V
Smite 5 V
Knockback 5 II
Fire Aspect 2 II
Looting 2 III
Sweeping Edge 2 III
Unbreaking 5 III
Pickaxe
Shovel
Axe
Hoe
Shears
18 with each other Fortune 2 III
Silk Touch 1 I
Efficiency 10 V
Unbreaking 5 III
Bow 20 Power 10 V
Flame 2 I
Punch 2 II
with Mending Infinity 1 I
Unbreaking 5 III
Fishing rod 9 Luck of the Sea 2 III
Lure 2 III
Unbreaking 5 III
Trident 15 Loyalty 5 III
Impaling 2 V
with each other Riptide 2 III
Channeling 1 I
Unbreaking 5 III
Crossbow 22 Piercing 10 IV
Quick Charge 5 III
Multishot 2 I
Unbreaking 5 III
Mace 12 with each other, Smite, and Bane of Arthropods Density 5 V
Breach 2 IV
Unbreaking 5 III
Spear 10 Lunge 5 III
Unbreaking 5 III

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:

  1. With a probability, pick an extra enchantment. Otherwise, stop.
  2. Remove from the list of possible enchantments anything that conflicts with previously-chosen enchantments.
  3. Pick one enchantment from the remaining possible enchantments (based on the weights, as before) and apply it to the item.
  4. 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).
  5. Repeat from the beginning.

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

[edit | edit source]

Some enchantments conflict with other enchantments and thus both can't be enchanted into the same item, whether for balance or logistical reasons.

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:

  • An item with multiple copies of the same enchantment uses the level of the first copy of that enchantment in the list.
  • For armor with conflicting protection enchantments, all enchantments take effect individually.
  • For weapons with conflicting damage enchantments, all enchantments take effect individually.
  • For tools with both Silk Touch and Fortune, Silk Touch takes priority over Fortune on blocks affected by both enchantments. Fortune still applies to blocks such as crops that are not affected by Silk Touch.
  • For bows with both Mending and Infinity, both enchantments work individually.
  • For tridents with both Loyalty and Riptide, Riptide still functions normally but the trident can no longer be thrown by the player. However, tridents can still be thrown using dispensers.‌[Bedrock Edition only]
  • For crossbows with both Multishot and Piercing, both enchantments work individually.
👁 Image
A chart showing all possible enchantments on diamond tools.[needs updating]

Enchanting seed

[edit | edit source]

The enchantments that the enchanting table offers to a player do not usually change until the player enchants an item. After each applied enchant, the player gets offered different enchantments for any type of enchantable item.

This is controlled by the enchanting seed XpSeed in the player data.

Deterministic initial enchantment

[edit | edit source]

This enchantment seed is initialized to 0 on world creation, and whenever the last enchantment seed was 0 on loading into a world it is re-rolled.[1] Hence, when a new world is played until the player performs their first enchant without closing and re-joining the world in between, the offered enchantments are always the same. They still depend on the enchanted item and the enchantment level.

These deterministic enchantments with the XpSeed equal to 0, colloquially known as first enchants, can be used to guarantee certain enchantments, e.g. a diamond sword enchanted with 3 lapis lazuli and 15 bookshelves always gets Unbreaking 3 and Looting 2.

Due to the fact that enchanting an item changes the enchanting seed, only one such first enchant can be chosen per world.

Note for tools

[edit | edit source]

All tools (axe, hoe, pickaxe, and shovel) will always offer the same enchantments for any given seed. For example, if a diamond hoe is offered Unbreaking I at level 1, Efficiency II at level 2, and Fortune II at level 3, then diamond shovels, axes, and pickaxes will also offer the same enchantments.

History

[edit | edit source]
Java Edition
1.18.222w07aBookshelf detection method changed. Previously, both the block at the level of the enchanting table and the layer above needed to be air, or the enchanting table was blocked. Additionally, bookshelves 2 across 1 over changed from being blocked by the corner block to being blocked by the edge block.

References

[edit | edit source]

External links

[edit | edit source]

Navigation

[edit | edit source]
Retrieved from "https://minecraft.wiki/w/Enchanting_table_mechanics?oldid=3610507"

Navigation menu