This is an idea for a new, early-to-mid game, alternative enchantment to Mending, called Well Tempered. It can applied to any item which Mending could go on, but the two enchantments are incompatible with each other. Well Tempered, unlike Mending can be gotten from an enchanting table.
If an item has Well Tempered on it, and is being worn or in the main hand or off hand, and it has a greater than zero Prior Work Penalty (the contents of the RepairCost tag), then any time the player acquires an experience orb, the enchanted item eats the orb, and performs the following pseudocode:
The amount of points which were in the orb is X.
The number of points the player needs to go from the beginning of their current level to the beginning of the next level is Y.
The Prior Work Penalty of the item is P.
Subtract X/Y from P, make this the new P.
If P is now 0 or negative, make the item's new Prior Work Penalty 0, then stop.
The fractional part of P is F.
Subtract F from P, make this the new P.
Create a random number between 0 and 1, call it R.
If F is more than R, increase P by 1.
Make the item's new Prior Work Penalty P.
This makes Well Tempered more effective the lower the player's level is, and because it cannot be combined with Mending, not usually worthwhile to put onto Diamond tools/equipment (unless you have lots and lots of diamonds, or have Armorer and Weaponsmith Villagers with the right trades), nor is it a good idea to put it on Netherite stuff (unless you're duping Netherite).
This is an idea for a new, early-to-mid game, alternative enchantment to Mending, called Well Tempered. It can applied to any item which Mending could go on, but the two enchantments are incompatible with each other. Well Tempered, unlike Mending can be gotten from an enchanting table.
If an item has Well Tempered on it, and is being worn or in the main hand or off hand, and it has a greater than zero Prior Work Penalty (the contents of the RepairCost tag), then any time the player acquires an experience orb, the enchanted item eats the orb, and performs the following pseudocode:
This makes Well Tempered more effective the lower the player's level is, and because it cannot be combined with Mending, not usually worthwhile to put onto Diamond tools/equipment (unless you have lots and lots of diamonds, or have Armorer and Weaponsmith Villagers with the right trades), nor is it a good idea to put it on Netherite stuff (unless you're duping Netherite).