Exact Java 26.2 calculation

Anvil calculator

Find the cheapest order for combining ready-made books and check the anvil limit.

Version Java 26.2Real-time optimization
1

Your item

Choose the gear that should receive the enchanted books.

Diamond Sword10 enchantments available
Prior works on the item
Current penalty0levelsAfter a normal operation, the penalty becomes 1.
2

Enchanted books

Select an enchantment, then set the chosen book level.

Selected: 4
SharpnessBook: 1 lv. per enchantment level
V
LootingBook: 2 lv. per enchantment level
III
UnbreakingBook: 1 lv. per enchantment level
III
MendingBook: 2 lv. per enchantment level
I
3

Combination tree

The cheapest order is rebuilt after every change.

Ready
Diamond SwordItem
Looting IIIBook
1+6
Unbreaking IIIBook
Mending IBook
2+2
3+7
Sharpness VBook
4+8
Result
Diamond Sword
Looting IIIUnbreaking IIIMending ISharpness V
Prior-work penalty: 7
Total cost23levels4 operations in the optimal order
Most expensive operation8 / 39
Naive order27lv.Savings: 4 lv.
Final penalty7After 4 operations

The calculation uses anvil_cost values from the Java 26.2 vanilla datapack and item prior-work penalties.

At the anvil

Step-by-step order

Keep the base item on the left and place the donor book on the right.

4 operations · max 8 in one step
1Apply book to itemRunning total: 6 lv.
Diamond swordBase itemBookLooting IIIDiamond swordLooting III
Cost: 6 lv.Penalty becomes 1
2Combine booksRunning total: 8 lv.
BookUnbreaking IIIBookMending ICombined bookUnbreaking III, Mending I
Cost: 2 lv.Penalty becomes 1
3Apply book to itemRunning total: 15 lv.
Diamond swordBase itemBookUnbreaking III, Mending IDiamond swordLooting III, Unbreaking III, Mending I
Cost: 7 lv.Penalty becomes 3
4Apply book to itemRunning total: 23 lv.
Diamond swordBase itemBookSharpness VDiamond swordLooting III, Unbreaking III, Mending I, Sharpness V
Cost: 8 lv.Penalty becomes 7

Anvil costs and the 39-level limit

Java 26.2. Selected enchantments represent separate fresh books at the required levels. The item's prior work increases costs, and a 40-level combination is blocked in Survival. Material repairs and existing item enchantments are outside this calculation.

Too Expensive: causes and what you can fix

Frequently asked questions

Why does the anvil say Too Expensive?

In Java Survival, a combination costing 40 levels or more is blocked. The limit applies to each operation, not the plan total. Having 100 levels does not remove it; renaming alone without repairs or enchantments is an exception.

How does the prior-work penalty grow?

A new item has a penalty of 0. Combining sets the new penalty to 2 × the larger input penalty + 1: 0, 1, 3, 7, 15, 31, 63. This reflects the depth of earlier combinations, not the total number of books used. Renaming alone does not increase it.

Should I combine every book into one first?

Not necessarily. Every transfer charges for the enchantments on the right-hand book, so both its contents and the two input penalties matter. The cheapest plan can mix individual books with small groups. The sum of level costs is not a number of XP points.

Can I reset the penalty and keep my enchantments?

A grindstone resets the penalty but removes ordinary enchantments and retains curses. Mending repairs durability with XP without increasing the penalty, but does not reset an existing one. If new enchantments exceed the limit, compare the same build on a fresh item.

Which item and book states does the calculation support?

The calculation uses Java 26.2 rules: one fresh book per selected enchantment, already at the desired level, with no prior work. The item can have a prior-work penalty. Material repairs, existing item enchantments, premade multi-enchantment books, and Bedrock are not modeled, so the displayed price is not an exact quote for those cases.