If you have ever spent hours grinding at a mob spawner XP farm, trading with librarian villagers to collect top-tier enchanted books, and then placed your Netherite Sword into an anvil only to be greeted by the infuriating red text "Too Expensive!", you know the absolute heartbreak. Minecraft completely blocks any anvil combination that costs 40 levels or more. For years, players assumed this was a random bug or an artificial hard cap designed to force you to craft new gear. But it isn’t random at all!
Understanding the Prior Work Penalty Math
Every single item, armor piece, tool, and enchanted book in Minecraft contains an invisible hidden tag in its NBT / Data Component structure called the RepairCost (Prior Work Penalty). Every single time an item passes through an anvil, whether you are combining books, applying a book to gear, renaming an item, or repairing durability, its prior work penalty increases exponentially according to the formula:
Prior work penalty = 2^N - 1, where N is the number of previous anvil operations carried by the item.
Where N is the number of times the item has been placed in an anvil. Look at how fast this level tax explodes:
Anvil Operations (N) |
Prior Work Penalty Added | Player Experience Impact |
|---|---|---|
| 0 Uses | +0 Levels | Freshly crafted item or book from table. |
| 1 Use | +1 Level | Negligible cost. Safe to combine. |
| 2 Uses | +3 Levels | Minor level tax added. |
| 3 Uses | +7 Levels | Noticeable cost increase. |
| 4 Uses | +15 Levels | Warning: High level tax building up. |
| 5 Uses | +31 Levels | High Risk! Next operation almost certainly fails. |
| 6 Uses | +63 Levels | TOO EXPENSIVE! (> 39 Level Cap Limit) |
If you naively apply books one by one directly onto your sword (Sword + Book 1, then Sword + Book 2, then Sword + Book 3...), the sword’s work count hits 5 after just 5 books. At Work Count 5, the penalty alone is 31 levels. Adding even a simple 1-level enchantment pushes the total cost over 39 levels, triggering the Too Expensive! error and locking your gear forever!

The Solution: The Binary Tree Combining Method
To bypass the 40-level cap, you must combine your enchanted books together into balanced pairs before applying them to your weapon or armor! This keeps the anvil work count on your target item as low as possible.
Example: Building a God Netherite Sword (6 Enchantments)
Goal: Sharpness V, Unbreaking III, Looting III, Sweeping Edge III, Fire Aspect II, and Mending.
- Phase 1 (Combine Books into Pairs):
- Book 1 (Sharpness V) + Book 2 (Unbreaking III) → Master Book A (Work Count: 1)
- Book 3 (Looting III) + Book 4 (Sweeping Edge III) → Master Book B (Work Count: 1)
- Book 5 (Fire Aspect II) + Book 6 (Mending) → Master Book C (Work Count: 1)
- Phase 2 (Combine Master Books):
- Master Book B + Master Book C → Super Book BC (Work Count: 2)
- Phase 3 (Apply to Target Sword):
- Sword + Master Book A → Enhanced Sword (Work Count: 1)
- Enhanced Sword + Super Book BC → God Netherite Sword (Final Work Count: 3!)
Because the sword only underwent 2 direct anvil operations, its final prior work penalty is only +3 levels instead of +31 levels! The exact total depends on the enchantments, their levels, item compatibility and slot order. Use the in-game anvil preview for every step instead of relying on one fixed total.
3 Golden Rules of Anvil Optimization
- Test both slot orders before taking the output: The two input orders can produce different costs because the sacrifice item contributes enchantment costs differently. Keep the target item in the first slot when applying a book, and compare both orders when combining compatible books.
- Enchant at the Enchanting Table first: An item enchanted directly from an Enchanting Table starts at Work Count 0.
- Rename during an operation you already need: Renaming separately creates another anvil operation. Add the name while performing a required combination, then confirm the displayed cost before accepting it.
Calculate your exact step-by-step anvil combining order with our MC Toolbox Enchant Calculator!
