Minecraft Wiki
Advertisement

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.

# 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 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):

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

Java Edition[]

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 white spaces are air, and the 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:

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[]

Enchantment table bookshelf placement

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

Java Edition[]

Enchantment table bookshelf placement 1.18

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 + 1

Where:

  • R1 and R2 are two individual randomly generated integers:
    • R1 = randomInt(0, floor(E / 4))
    • R2 = randomInt(0, floor(E / 4))
  • B is the base enchantment level.
  • E is the enchantability of the item.

Enchantability[]

Material Armor enchantability Sword/Tool enchantability
Wood N/A 15
Leather 15 N/A
Stone N/A 5
Chain 12 N/A
Iron 9 14
Gold 25 22
Diamond 10 10
Turtle 9 N/A
Netherite 15 15
Other 1 1

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 = 1

The source is Minecraft 1.8 source code.

Step two – Find possible enchantments[]

Powersword

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:

  1. Calculate the total weight of all enchantments in the list (T). The total of every enchantment is 136.
  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.
Type of enchantment Enchantment Weight Obtainable from an enchanting table
Armor Protection 10 Yes
Feather Falling 5 Yes
Fire Protection 5 Yes
Projectile Protection 5 Yes
Aqua Affinity 2 Yes
Blast Protection 2 Yes
Respiration 2 Yes
Depth Strider 2 Yes
Frost Walker 2 No
Thorns 1 Yes
Swift Sneak 1 No
Curse of Binding 1 No
Soul Speed 1 No
Sword Sharpness 10 Yes
Bane of Arthropods 5 Yes
Knockback 5 Yes
Smite 5 Yes
Fire Aspect 2 Yes
Looting 2 Yes
Sweeping Edge 2 Yes
Pickaxe
Shovel
Axe
Hoe
Shears
Efficiency 10 Yes
Fortune 2 Yes
Silk Touch 1 Yes
Bow Power 10 Yes
Flame 2 Yes
Punch 2 Yes
Infinity 1 Yes
Fishing rod Luck of the Sea 2 Yes
Lure 2 Yes
Trident Loyalty 5 Yes
Impaling 2 Yes
Riptide 2 Yes
Channeling 1 Yes
Crossbow Piercing 10 Yes
Quick Charge 5 Yes
Multishot 2 Yes
All applicable Unbreaking 5 Yes
Mending 2 No
Curse of Vanishing 1 No

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:

  1. With probability (modified level + 1) / 50, keep going. Otherwise, stop picking bonus enchantments.
  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[]

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:

  • Every enchantment conflicts with itself. (The player can't get a tool with two copies of the Efficiency enchantment.)
  • All damage enchantments (Sharpness, Smite, and Bane of Arthropods) conflict with each other.
  • All protection enchantments (Protection, Blast Protection, Fire Protection, Projectile Protection) conflict with each other.
  • Silk Touch conflicts with Fortune, Looting, and Luck of the Sea.
  • Depth Strider and Frost Walker conflict with each other.
  • Mending and Infinity conflict with each other.
  • Riptide conflicts with Loyalty and Channeling.
  • Multishot and Piercing conflict with each other.

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.
Image005

A chart showing all possible enchantments on diamond tools.[needs updating]

History[]

Java Edition
1.18.2
{{Extension DPL}}<ul><li>[[Iron Nugget|Iron Nugget]]<br/>{{About|the nugget|the ore|Iron Ore|the item|Iron Ingot|the mineral block|Block of Iron}}
{{Item
| image = Iron Nugget.png
| renewable = Yes
| stackable = Yes (64)
}}
'''Iron nuggets''' are pieces of iron that can be obtained by [[smelting]] iron [[tools]]/[[Sword|weapons]] or iron/chainmail [[armor]]. One iron nugget is worth one-ninth of an [[iron ingot]].

== Obtaining ==

=== Crafting ===

{{Crafting
|Iron Ingot
|Output= Iron Nugget,9
|type=Material
}}

=== Smelting ===

{{Smelting
|Iron Sword; {Any iron tools}; {Any iron armor}; {Any chainmail armor}; Iron Horse Armor
|Iron Nugget
|0,1
}}
[[Item durability|Durability]] and [[enchantments]] do not affect the ability to smelt iron tools, weapons, or armor into iron nuggets.

=== Bartering ===
[[Piglins]] may [[barter]] 9–36 iron nuggets when given a [[gold ingot]].

=== Chest loot ===

{{LootChestItem|iron-nugget}}

== Usage ==

Iron nuggets are used to craft [[iron ingot]]s, [[lantern]]s, [[soul lantern]]s, and [[chain]]s.

=== Crafting ingredient ===

{{crafting usage}}

== Data values ==
=== ID ===
{{edition|java}}:
{{ID table
|edition=java
|showforms=y
|generatetranslationkeys=y
|displayname=Iron Nugget
|spritetype=item
|nameid=iron_nugget
|form=item
|foot=1}}

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|shownumericids=y
|showforms=y
|notshowbeitemforms=y
|generatetranslationkeys=y
|displayname=Iron Nugget
|spritetype=item
|nameid=iron_nugget
|id=569
|form=item
|foot=1}}

== History ==

{{History|java}}
{{History||1.11.1|snap=16w50a|[[File:Iron Nugget JE1 BE1.png|32px]] Added iron nuggets. 
|Iron nuggets can be used to craft [[iron ingot]]s.
|Iron nuggets are obtained from [[smelting]] iron [[tool]]s and [[armor]].}}
{{History||1.13|snap=17w47a|Prior to [[1.13/Flattening|''The Flattening'']], this item's numeral ID was 452.}}
{{History|||snap=18w11a|Iron nuggets now generate in [[shipwreck]] [[chest]]s.}}
{{History||1.14|snap=18w46a|Iron nuggets are now used to craft [[lantern]]s.}}
{{History|||snap=18w50a|Iron nuggets can now be found in chests in [[taiga]] [[village]] houses.}}
{{History||1.16|snap=20w06a|Iron nuggets are now used to craft [[soul fire lantern]]s.}}
{{History|||snap=20w10a|Iron nuggets now have a {{frac|10|411}} (~2.43%) chance of being given by [[piglin]]s when [[bartering]], in a stack size of 9–36.}}
{{History|||snap=20w16a|Iron nuggets are now used to craft [[chain]]s.|Iron nuggets now generate in [[ruined portal]] and [[bastion remnant]] [[chest]]s.}}

{{History|pocket}}
{{History||1.1.0|snap=alpha 1.1.0.0|[[File:Iron Nugget JE1 BE1.png|32px]] Added iron nuggets.
|Iron nuggets can be used to craft [[iron ingot]]s.
|Iron nuggets are obtained from [[smelting]] iron [[tool]]s and [[armor]].}}
{{History|bedrock}}
{{History||1.4.0|snap=beta 1.2.20.1|Iron nuggets can now be found in some [[shipwreck]] [[chest]]s.}}
{{History||1.10.0|snap=beta 1.10.0.3|Iron nuggets are now used to craft [[lantern]]s.}}
{{History||1.11.0|snap=beta 1.11.0.1|Iron nugget can now be found in [[taiga]] [[village]] house chests.}}
{{History||1.16.0|snap=beta 1.16.0.51|Iron nuggets are now used to craft [[soul fire lantern]]s.}}
{{History|||snap=beta 1.16.0.57|Iron nuggets now have a {{frac|10|411}} (~2.43%) chance of being given by [[piglin]]s when [[bartering]], in a stack size of 9–36.
|Iron nuggets now generate in [[ruined portal]] and [[bastion remnant]] [[chest]]s.}}
{{History|||snap=beta 1.16.0.59|Iron nuggets are now used to craft [[chain]]s.}}
{{History||1.16.100|snap=beta 1.16.100.50|Iron nuggets can now be used as fuel in a [[furnace]].<ref>{{bug|MCPE-114216}}</ref>}}
{{History||1.18.30|snap=beta 1.18.30.26|Iron nuggets can no longer be used as fuel in a furnace.}}

{{History|console}}
{{History||xbox=TU53|xbone=CU43|ps=1.49|wiiu=Patch 23|switch=1.0.3|[[File:Iron Nugget JE1 BE1.png|32px]] Added iron nuggets. 
|Iron nuggets can be used to craft [[iron ingot]]s.
|Iron nuggets are obtained from [[smelting]] iron [[tool]]s and [[armor]].}}
{{History||xbox=none|xbone=none|ps=1.90|wiiu=none|switch=none|Iron nuggets are now used to craft [[lantern]]s}}

{{History|new 3ds}}
{{History||1.9.19|[[File:Iron Nugget JE1 BE1.png|32px]] Added iron nuggets.
|Iron nuggets can be used to craft [[iron ingot]]s.
|Iron nuggets are obtained from [[smelting]] iron [[tool]]s and [[armor]].}}
{{History|foot}}

== Issues ==
{{issue list}}

==Gallery==
<gallery>
Pocket Edition Iron Nugget.jpg|First image of an iron nugget in ''Bedrock Edition''.
</gallery>

== See also ==
*[[Gold Nugget]]
*[[Iron]]

== References ==
{{Reflist}}

{{Items}}

[[de:Eisenklumpen]]
[[fr:Pépite de fer]]
[[ja:鉄塊]]
[[ko:철 조각]]
[[nl:IJzerklompje]]
[[pl:Bryłka żelaza]]
[[pt:Pepita de ferro]]
[[ru:Кусочек железа]]
[[uk:Залізний самородок]]
[[zh:铁粒]]
[[Category:Renewable resources]]</li><li>[[Photo|Photo]]<br/>{{exclusive|education}}
{{Item
| image = Photo EE2.png
| renewable = No (unless [[portfolio]] is available)
| stackable = 
}}

A '''photo''' is an [[item]] containing a picture taken with a [[camera]].<ref>{{cite|url=https://web.archive.org/web/20210925044841mp_/https://educommunity.minecraft.net/hc/en-us/articles/4407489082644-Feature-Walkthrough-Minecraft-Education-Edition-GOAT-Beta-version-1-17-30-| title = Feature Walkthrough Minecraft: Education Edition GOAT Beta (version 1.17.30)|website=Minecraft: Education Edition Support|date=September 24, 2021}}</ref><ref>{{cite|url=https://education.minecraft.net/en-us/blog/new-update-and-anniversary-for-mee| title = The GOAT Update Celebrates a Minecraft Milestone!|website=Minecraft: Education Edition|date=November 2, 2021}}</ref><ref>{{ytl|2Wd0J-EIfws|GOAT Release Playthrough|Minecraft: Education Edition|December 2, 2021}}</ref>

== Obtaining ==
A photo in a [[portfolio]] can be saved as a photo item by selecting the "Save to Inventory" button underneath it.

== Usage ==
Photos display an image when held in the hand or when placed in an [[item frame]], similarly to [[map]]s. Photos can have captions added to them by renaming them in an [[anvil]] or by adding a caption while they are in a portfolio. Photos can be added to [[book and quill]]s and portfolios by selecting the "Add Photo" button in the book and quill or portfolio.

== Data values ==
=== ID ===
{{ID table
|edition=bedrock
|shownumericids=y
|showforms=y
|notshowbeitemforms=y
|generatetranslationkeys=y
|displayname=Photo
|spritetype=item
|nameid=photo_item
|id=?
|form=item
|foot=1}}

== History ==
{{History|education}}
{{History||1.17.30|snap=1.17.30.2|[[File:Photo EE1.png|32px]] Added photos.}}
{{History||1.17.30|snap=release|[[File:Photo EE2.png|32px]] Changed photo texture.}}
{{History|foot}}

== Gallery ==
<gallery>
Photo Item 1.png|A photo being placed in an item frame.
Photo Item 2.png|A photo being saved from a portfolio.
Photo Item 3.png|A photo being added to a book and quill.
</gallery>

== References ==
{{Reflist}}

{{Items}}
{{Education Edition}}

[[Category:Education Edition items]]
[[Category:Non-renewable resources]]

[[ja:写真]]
[[pl:Zdjęcie]]
[[zh:相片]]</li></ul>
22w07aBookshelf 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[]


External links[]

  • There was a Web page for testing enchantments. While it no longer exists, it is still available on the WayBack Machine
  • This site provides some ability to test enchantments, although its interface is significantly less verbose on the specifics
Advertisement