Download Enchantment Calculator — Minecraft Mods — MetaMods

Enchantment Calculator

Active

Downloads

0

Last update

3 months ago

Versions

1.21 — 1.21.8
Client
Fabric
Weapons and armor
Game mechanics
Utils

Enchantment Calculator

What is this mod?

Enchantment Calculator is a client-side mod that helps find the most cost-effective way to apply enchantments to your items in Minecraft.

How to use

  1. Place an item in the anvil
  2. Select enchantments from the left panel
  3. Click "Calculate" to find the optimal sequence
  4. Follow the steps shown in the right panel
  5. Navigate between steps using arrow buttons

Interface customization

The mod supports customization through custom resource packs. Interface elements are located at: assets/enchantmentcalculator/textures/gui

Technical algorithm features

Tree-based optimization

The mod uses a sophisticated tree-based optimization algorithm to find the most efficient enchantment sequence.

Cost calculation

The mod accurately calculates costs according to Minecraft's anvil mechanics:

Total cost = Enchantment cost + Prior work penalty

Enchantment weight system

Weight 1: protection, sharpness, efficiency, unbreaking, power
Weight 2: fire aspect, looting, fortune, punch, flame
Weight 4: mending, silk touch, infinity, curse of binding

Performance optimization

Instead of testing all possible trees, the algorithm:

  • Groups trees by maximum depth
  • Calculates weighted contribution sums for each tree
  • Keeps only the best tree per depth level
  • Reduces complexity from O(n!) to O(n²)

Optimization modes

  • Level mode: Minimizes total level cost
  • Experience mode: Minimizes total XP consumption

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

Known issues

  • Interface overflows off-screen when using UI scale 4

This algorithm guarantees mathematically optimal enchantment sequence while maintaining high performance for real-time gameplay.

Project members
FanyaOff

FanyaOff

Developer

Created: 22 Jul 2025

ID: 256507