Compatibility
Minecraft: Java Edition
Platforms
75% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+Links
Creators
Details
Have you ever thought that Mending is way too overpowered?
You thought that remove it is the only solution?
But even that, you still LOVE Mending?
Then fear not,
Durability Tweak is for you!
The concept is quite simple (idk if 'simple' is the right word):
- Change how Prior Use Penalty work.
- Remove 'Too Expensive' in Anvil.
- Increase max level of Unbreaking.
- Change how Unbreaking work, both tools and armors.
- Lower the efficiency of Mending by lower the DUR/XP ratio.
- Add RNG to Mending (Sometimes it works, sometimes not.)
- The efficiency of Mending is tied to Unbreaking, the higher Unbreaking level is, the lower efficiency of Mending is.
- Limit the maximum durability that Mending can repair (kinda like lower the maximum durability, but you can still repair that item using anvil).
Planning:
- Port to Fabric + NeoForge.
- Update to newer Minecraft version.
License
Nah, you can make your own version, port to Fabric, backport to another version of Minecraft, add / remove features, or... whatever. Just leave me a credit. Thanks
Why + Techinal Info:
The durability mechanics in Minecraft is such a disaster. Before Mending is a thing, you have to repair your tools & armors with Anvil, which you can easily done until it reach level cap -_- And even before that, when Enchantment first added to the game, unless you have lucky to get Unbreaking, your tools will return to the dust so quickly.
Mojang added Mending to the game like a QoL enchantment that act as a solution for Durability mechanics. But it affect the gameplay so much that it turns to the MUST-HAVE enchantment in every single world.
To be honest, I don't think the Durability mechanics is the root of problem. It encourage player to explore and change their gears overtime. The actual one, in my opinion is Anvil.
The Anvil using XP cost system when repair and enchant. It's seem ok at first, but the cost will soon become so high that you just can never get much level, plus the 40-level cap in Anvil. Most of these XP cost come from Prior Use Penalty, based on how many times you repair / enchant an item using Anvil:
priorUsePenalty = 2^useCount - 1;
In fact, Minecraft using a recursive method:
public static int calculateIncreasedRepairCost(int previousUseCost) {
int newUseCost = previousUseCost * 2 + 1;
return newUseCost;
}
And yah, this mod change it to a linear scale:
newUseCost = previousUseCost + 3;
I mean, I can understand why Mojang decide to use previous formula. But it's just so terrible. And bruh, XP Level itself is not linear, so why? Mojang?
But in very, very long run, you may still need to replace your gears, or just put Mending on them :V
Heck yeah, change the Penalty and remove 'Too Expensive' is NOT the silver-bullet solution. Mending is still a thing, after all. So in order to balance it (which it's the original goal of this mod, but kinda hard, to be honest), the first thing I do is buffing Unbreaking (yeah, why not).
Unbreaking now have max level is 5, lower enchanting cost in Enchant Table (hidden mechanics), and share the same formula between all damagable item (tools & armors):
durabilityDropChance = 1 / (unbreakingLevel + 0.35)
and the result:
Unbreaking Level | Durability Drop Chance |
---|---|
0 | 100% |
1 | 74.07% |
2 | 42.55% |
3 | 29.85% |
4 | 22.99% |
5 | 18.69% |
Note1: I did it using mixin, directly hook to DigDurabilityEnchantment.class, so you can find Unbreaking 5 in trade with Villager.
Note2: Seem like the actual rate is a bit lower than Vanilla, but armor still much better.
Next is Mending. The core of Mending is "Let you use your tools forever", but it comes with zero drawback. I personally don't wanna change its core, but the enchantment itself need to have some downsides to be balanced, which can have enough impact to make player think before add Mending to their gears, but the enchantment itself still need to be useful enough to not being throw to the garbage.
So, first nerf is change the efficiency of Mending. It's now tied to Unbreaking level. The higher Unbreaking level is, the lower efficiency of Mending is.
In vanilla Minecraft, 1 XP => 2 durability with no RNG. It's so high that you can repair a full netherite set in only 2 minutes.
Now, when player receive XP Orb, 1 orb will be assign to 1 random item in a selected list (I'll explain the list later), then for every XP inside this orb, it'll run though this (pseudo-)code:
if (RandomSource.create().next(unbreakingLevel + 2) == 0)
item.repair();
That means, 1 XP => 1 durability, if your RNG is good :V
The RNG table is:
Unbreaking Level | Mending Efficiency |
---|---|
0 | 50.00% |
1 | 33.33% |
2 | 25.00% |
3 | 20.00% |
4 | 16.67% |
5 | 14.29% |
Next aspect of Mending is XP Earning. Kinda overkill, but when you have Mending item in atleast 1 of 6 EquipmentSlot (Armors + OffHand + MainHand), you will not earn XP. All of them will be using in repairing items and even they have full durability, these XP will just disappeared. Kinda straight forward.
Next one is Durability Limit. I design this mechanics mostly for my server, which have C4 and some kinds of explosive items. All of them can easily break your gears, even you somehow manage to survive. So to make anvil shine again in some specific cases (like PVP), Mending enchantment can only repair a part of maximum durability of gears. And yes, it's again tied to Unbreaking (hell yeah I make Unbreaking so important in durability mechanics).
The ratio is:
float dmgRatio = 9F / (6 + 4*unbreakingLevel);
and the result:
Unbreaking Level | Max Mending Durability |
---|---|
0 | 100% |
1 | 90.00% |
2 | 64.29% |
3 | 50.00% |
4 | 40.91% |
5 | 34.62% |
Remember, you can still fully repair your gears with anvil. Mending will only work if durability of your gears drop to below these number. I set these number high enough that in normal situation (fighting against mobs), your gears just can't break.
And yeah, remember I said 1 orb will be assign to 1 random item in a selected list
? In vanilla Minecraft, the game will random choose a item that meet these conditions:
- Is in 1 of 6 EquipmentSlot
- Has Mending Enchantment
- Not has full durability
It... kinda works, but not idealy for this mod. So I design my own one:
- Is in 1 of 6 EquipmentSlot
- Has Mending Enchantment
- Has durability below the activation point.
Yeah that is. Hope you like it.