
Modrinth · Minecraft mod
Enchantment Calculator
Client-side mod that calculates optimal enchantment paths to save XP and levels when enchanting gear, tools, weapons, and armor.
Quick answer
Which Enchantment Calculator release should I use?
Enchantment Calculator 2.0.1+26.3 targets 26.3 with Fabric. It must be installed on the client. Do not install it on the dedicated server. No extra mods listed for this file.
Where it goes
Is Enchantment Calculator required on the client, server, or both?
It must be installed on the client. Do not install it on the dedicated server.
This file is marked client-only.
What else does Enchantment Calculator 2.0.1+26.3 need?
2.0.1+26.3. Change the file and its required mods may change too.
This file does not list any required mods. Do not add a library just because a different file uses it.
This file does not list any required or optional mods.
Before you install it
Add Enchantment Calculator without breaking your instance.
Built for Enchantment Calculator 2.0.1+26.3. Pick another file and the loader, install side or required mods may change.
- 01
Stick to this file
Use 2.0.1+26.3. It targets 26.3 with Fabric; another release may have different loader, side or dependency requirements.
- 02
Bring the mods it needs
This file does not list any required mods. Do not add a library just because a different file uses it.
- 03
Put it on the correct side
It must be installed on the client. Do not install it on the dedicated server.
- 04
Pick the file you checked
Use the “Get this file” button beside 2.0.1+26.3. It opens that exact file at the source.
About this project
What does Enchantment Calculator add?
Overview
Enchantment Calculator is a client-side mod that helps you find the most cost-effective way to combine enchantments on your items.
This mod is based on the functionality provided by this website
This mod supports customization via a custom resource pack. GUI elements are located at:assets/enchantmentcalculator/textures/gui
You can view the original textures in the source code on GitHub
If you have an idea to improve the interface by redrawing the elements or by changing the code, I would appreciate it.
Since 2.0 update:
- reworked gui
- auto-enchantment function
- improved calculate algorithm + added way to optimize by xp
- added a "Use Book" feature that automatically takes books from your inventory and adds their enchantments to the calculator
- 26.x support
- added preset support for auto-enchantment
IMPORTANT!!!!! Before using the auto-enchantment feature, please get approval from your server admins. Otherwise, use the fair play edition
Bug Reports & Feature Requests
Found a bug, errors in calculations, have a suggestion? Please report it my our GitHub Issues page.
Usage
- Place an item in the anvil
- Select enchantments from the left panel
- Click Calculate to find the optimal sequence
- Follow the steps shown in the right panel
- Navigate through steps using arrow buttons
Screenshots
Main gui
Preset gui
Technical Algorithm Overview
Optimization Algorithm
The Enchantment Calculator uses a sophisticated tree-based optimization algorithm to find the most cost-effective enchanting sequence.
Core Algorithm Steps:
1. Tree Structure Generation
For n enchantments, generate all possible binary combination trees
- Each leaf = enchantment book or base item
- Each internal node = anvil combination operation
- Tree depth determines maximum prior work penalty
2. Cost Calculation Model
The mod calculates costs using Minecraft's exact anvil mechanics:
Total Cost = Enchantment Cost + Prior Work Penalty
Where:
- Enchantment Cost: Based on enchantment rarity weights
- Prior Work Penalty:
MULTIPLIERS[left_uses] + MULTIPLIERS[right_uses] - Multipliers:
[1023]
3. Tree Pruning Optimization
Instead of testing all possible trees, the algorithm:
- Groups trees by maximum depth (anvil use count)
- Calculates weighted contribution sums for each tree
- Keeps only the best tree per depth level
- Reduces complexity from O(n!) to O(n²)
4. Item Placement Optimization
For each tree structure:
1. Sort enchantment books by cost (expensive first)
2. Calculate leaf contribution values for each position
3. Place expensive items at positions with lowest contributions
4. Minimize total weighted cost
5. Multi-Mode Optimization
Supports two optimization targets:
- Level Mode: Minimizes total anvil level cost
- Experience Mode: Minimizes total XP expenditure
Mathematical Foundation
Prior Work Penalty Calculation:
penalty = MULTIPLIERS[left_item_uses] + MULTIPLIERS[right_item_uses]
Experience Cost Conversion:
if (levels ≤ 16): xp = levels² + 6×levels
if (levels ≤ 31): xp = 2.5×levels² - 40.5×levels + 360
if (levels > 31): xp = 4.5×levels² - 162.5×levels + 2220
Tree Contribution Weighting:
For each tree position i:
contribution[i] = depth_from_root
weighted_sum = Σ(i × contribution[i])
Algorithm Complexity
- Time Complexity: O(n² × 2^n) where n = number of enchantments
- Space Complexity: O(n × 2^n) for tree storage
- Practical Performance: <100ms for typical 5-7 enchantments
Enchantment Weight System
The mod uses empirically determined weights matching Minecraft's internal costs:
Weight 1: protection, sharpness, efficiency, unbreaking, power
Weight 2: fire_aspect, looting, fortune, punch, flame
Weight 4: mending, silk_touch, infinity, curse_of_binding
Tree Search Strategy
- Generate all possible binary tree structures
- Filter by maximum depth to reduce search space
- Score each tree using weighted contribution analysis
- Select optimal trees per depth level
- Test item placements for each selected tree
- Return globally optimal solution
Edge Case Handling
- Single enchantment: Direct application (cost = weight × level)
- Two enchantments: Simple combination without tree search
- Incompatible enchantments: Filtered during selection phase
- Maximum anvil uses: Capped at 6 uses (cost = 1023 levels)
This algorithm ensures you get the mathematically optimal enchanting sequence while maintaining fast performance suitable for real-time gameplay.
Project description from Modrinth.
Pick your setup
Enchantment Calculator by Minecraft version and loader
Choose the version and loader you play, then open the matching release.
26.2
1 loader build26.1.2
1 loader build26.1.1
1 loader build26.1
1 loader build1.21.11
1 loader build1.21.10
1 loader build1.21.9
1 loader build1.21.8
1 loader build1.21.7
1 loader build1.21.6
1 loader build1.21.5
1 loader buildShowing the newest 12 of 17 game versions. Older files are in the list below.
Check the dependencies, then try the file in a copied instance before changing a world you care about.
Recent files
Enchantment Calculator versions and loaders
2.0.1+26.3
enchantmentcalculator-2.0.1+26.3.jar
11 Nov 2026
2.0.1+26.2
enchantmentcalculator-2.0.1+26.2.jar
11 Nov 2026
2.0.1+26.1
enchantmentcalculator-2.0.1+26.1.jar
11 Nov 2026
2.0.1+1.21.11
enchantmentcalculator-2.0.1+1.21.11.jar
11 Nov 2026
2.0.1+1.21.10
enchantmentcalculator-2.0.1+1.21.10.jar
11 Nov 2026
2.0.1+1.21.9
enchantmentcalculator-2.0.1+1.21.9.jar
11 Nov 2026
2.0.1+1.21.8
enchantmentcalculator-2.0.1+1.21.8.jar
11 Nov 2026
2.0.0+26.3
enchantmentcalculator-2.0.0+26.3.jar
15 Oct 2026
2.0.0+26.2
enchantmentcalculator-2.0.0+26.2.jar
15 Oct 2026
2.0.0+26.1
enchantmentcalculator-2.0.0+26.1.jar
15 Oct 2026
2.0.0+1.21.11
enchantmentcalculator-2.0.0+1.21.11.jar
15 Oct 2026
2.0.0+1.21.10
enchantmentcalculator-2.0.0+1.21.10.jar
15 Oct 2026
Looking for an older file? The official Modrinth project page is in Resources.