Compatibility
Minecraft: Java Edition
Platforms
Supported environments
Creators
Details
Summary
When enchanting an item, a list of enchanted books will display any compatible enchantments that are accessible from the enchanting table. When apploying, enchantments are applied one level at a time. The cost to apply enchantments increases with each level.
I tried my best to make this work in all languages without requiring the mod on the client. This forced me to used existing translation keys which may result in some weird translation artifacts.
Details
When a player interacts with an enchanting table they will see the following menu:
The first open slot is for the item to enchant.
The second open slot is for the lapis.
The bookshelves exist to inform how many bookshelves.
When an item is inserted in the menu, the books will be replaced with enchanted books showing the available enchantments for the item. Each enchantment will a cost associated with it in the form of experience levels, lapis lazuli, and the number of bookshelves required to apply it.
Price Calculations & Modification
The prices are calculated based on the enchantment definitions.
Level costs are calculated using the formula:
(( anvil_cost + min_cost.base + 1 ) + ( levelToApply - 1 )( min_cost.per_level_above_first ))/2
Bookshelf requirements are calculated using the formula:
min_cost.base + ( levelToApply - 1 ) * Math.min( min_cost.per_level_above_first / 2, (MAX_BOOKSHELVES - min_cost.base ) / max_level )
Lapis cost is always equal to the level of the enchant being applied.
Using these formulas you may edit the level and bookshelf requirements by creating a datapack to modify the appropriate values for any enchantments you wish.
##Future Plans
- Advanced configuration?