Enchantment Decay
Magic is an incredible force from ancient times that allows you to enhance your influence over the world. One of the preserved traces of this ancient knowledge that can be discovered during travels is enchantments. However, over time this knowledge has eroded, and even what can be obtained from the few surviving remnants of the civilization that once mastered this art is far from perfect. Yet you managed to recreate it. You were able to assemble your own enchanting table and infuse the power accumulated along your journey into your tools. But as expected, the knowledge you've gathered is still insufficient, and you notice that as you use enchanted gear, the magic gradually fades...
⚠️ Currently, this mod is considered unbalanced. Therefore, any suggestions for improving balance will be gratefully accepted.
How It Works
Each spell affects your life in its own way. This mod tracks numerous situations where enchantments are used and registers their usage as a potential source of wear. Thus, each time an enchantment affects gameplay, there's a chance it will wear down slightly. When wear reaches a certain level, the enchantment level decreases, and wear resets.
The wear level of a tool is displayed next to the spell name. However, while exploring the world, when discovering enchanted loot, there's a chance it will be wear-resistant. Such instances can be recognized by the green symbol ˣ before the name.
Configuration
In your game's config folder after the first launch, a file enchantment_decay.properties will be created. This file contains all the necessary mod settings.
Default Values
The configuration file includes several default values:
- Default maximum wear: determines how much an enchantment can wear by default
- Default wear probability: indicates the probability (in percentage) of enchantment wear upon use. Set to 0 to disable wear by default
- Loot wear probability: determines the probability (in percentage) that enchantment on generated loot already has wear. Does not affect wear-resistant spells. Set to 0 to disable wear on generated loot
- Maximum loot wear percentage: indicates the maximum percentage of wear for enchantment on generated loot relative to the spell's maximum wear
- Wear-resistant loot probability: determines the probability (in percentage) that enchantment on generated loot will be wear-resistant
Spell-Specific Settings
Configuration files also support individual values for each spell:
- Maximum wear: registered as
decay.max.<namespace>.<path>, indicates the maximum wear value for instances of this spell - Wear probability: registered as
decay.probability.<namespace>.<path>, indicates the probability (in percentage) of wear for an instance of this spell upon use
Example:
decay.max.minecraft.efficiency=50
decay.probability.minecraft.efficiency=8
The provided example sets that any instance of the Efficiency enchantment from vanilla game can have up to 49 wear units before level decrease, and will have an 8% chance of wear with each use.
Spell Management
This mod uses spell tags to function. Each tag corresponds to a potential wear source (for example, kill for kills, fall for falls, hurt for taking damage, damage for gear piece damage, etc.)
All these spells are registered as enchantment_decay:decay/<name>, meaning in the folder data/enchantment_decay/tags/enchantments/decay/ within a datapack.
You can use a datapack to overhaul or add to these tags, changing which spells wear out in which situations.
The blacklist tag is the only exception, as it defines spells that cannot wear out. By default, this tag contains only curses.
Damage Types
Starting from version 1.20, Enchantment Decay also uses damage types to apply wear on armor when receiving certain types of damage. For this, each wear source can be linked to a damage source tag that indicates whether the corresponding spells should receive wear from such damage.
The tags used for this are registered as enchantment_decay:decay/<name>, meaning in the folder data/enchantment_decay/tags/damage_type/decay/ within a datapack.
