A little context. A clearer answer.
When this calculator is useful
Choose an unenchanted Java 1.21 item. Enter at most eight books as code, target level and previous-work count, one per line. Use the supported-code table. The optimizer considers both book orientations and combination trees, keeping every operation below 40 levels. For a related calculation, try Minecraft Nether portal coordinate calculator.
What to enter
| Input | What it means | Example value |
|---|---|---|
| Game edition | Game edition. Choose an unenchanted Java 1.21 item. Enter at most eight books as code, target level and previous-work count, one per line. Use the supported-code table. The optimizer considers both book orientations and combination trees, keeping every operation below 40 levels. | Minecraft Java 1.21 |
| Item | Item. Choose an unenchanted Java 1.21 item. Enter at most eight books as code, target level and previous-work count, one per line. Use the supported-code table. The optimizer considers both book orientations and combination trees, keeping every operation below 40 levels. | Sword |
| Previous anvil operations | Previous anvil operations. Choose an unenchanted Java 1.21 item. Enter at most eight books as code, target level and previous-work count, one per line. Use the supported-code table. The optimizer considers both book orientations and combination trees, keeping every operation below 40 levels. | 0 |
| Books: code level prior-work, one per line | Books: code level prior-work, one per line. Choose an unenchanted Java 1.21 item. Enter at most eight books as code, target level and previous-work count, one per line. Use the supported-code table. The optimizer considers both book orientations and combination trees, keeping every operation below 40 levels. Sword: sharpness 1–5, smite 1–5, bane_of_arthropods 1–5, looting 1–3, sweeping 1–3, fire_aspect 1–2, knockback 1–2. Pickaxe: efficiency 1–5, fortune 1–3, silk_touch 1. Helmet: protection 1–4, respiration 1–3, aqua_affinity 1, thorns 1–3. Boots: protection 1–4, feather_falling 1–4, depth_strider 1–3, frost_walker 1–2, soul_speed 1–3. Bow: power 1–5, punch 1–2, flame 1, infinity 1. Crossbow: quick_charge 1–3, multishot 1, piercing 1–4. Trident: impaling 1–5, loyalty 1–3, channeling 1, riptide 1–3. Mace: density 1–5, breach 1–4, wind_burst 1–3. Fishing rod: luck_of_the_sea 1–3, lure 1–3. Code: unbreaking 1–3, mending 1, vanishing_curse 1. Previous anvil operations: 0–5. | sharpness 5 0 unbreaking 3 0 mending 1 0 |
How the calculation works
- Choose an unenchanted Java 1.21 item. Enter at most eight books as code, target level and previous-work count, one per line. Use the supported-code table. The optimizer considers both book orientations and combination trees, keeping every operation below 40 levels.
- Sword; sharpness 5 0; unbreaking 3 0; mending 1 0 ⇒ Minimum sum of levels: 14; Number of operations: 3.
- Java 1.21 reference model, not Bedrock. Minimize the sum of charged levels, not XP points. Each book has one unique enchantment already at the target level; no combining duplicate low-level books, repairs, renaming or existing enchantments. Previous-work penalties are included. Incompatible books and impossible survival-mode plans are rejected.
cost(L,R) = penalty(L) + penalty(R) + Σ book_weight(e) × level(e in R); penalty′ = 2 max(penalty(L),penalty(R)) + 1; cost < 40A worked example
Sword; sharpness 5 0; unbreaking 3 0; mending 1 0 ⇒ Minimum sum of levels: 14; Number of operations: 3.
Example you can load
What to enterThis is a fixed example; changing the form above does not change these numbers.
Assumptions & limits
Java 1.21 reference model, not Bedrock. Minimize the sum of charged levels, not XP points. Each book has one unique enchantment already at the target level; no combining duplicate low-level books, repairs, renaming or existing enchantments. Previous-work penalties are included. Incompatible books and impossible survival-mode plans are rejected.
Frequently asked questions
What should I enter?
Choose an unenchanted Java 1.21 item. Enter at most eight books as code, target level and previous-work count, one per line. Use the supported-code table. The optimizer considers both book orientations and combination trees, keeping every operation below 40 levels.
How is the result calculated?
Sword; sharpness 5 0; unbreaking 3 0; mending 1 0 ⇒ Minimum sum of levels: 14; Number of operations: 3.
What does the model leave out?
Java 1.21 reference model, not Bedrock. Minimize the sum of charged levels, not XP points. Each book has one unique enchantment already at the target level; no combining duplicate low-level books, repairs, renaming or existing enchantments. Previous-work penalties are included. Incompatible books and impossible survival-mode plans are rejected.