A mod that adds player attributes which give a percentage chance to prevent durability loss on equipment.
The mod currently adds these attributes:
durability_preservation_attributes:durability_save_chancedurability_preservation_attributes:armor_durability_save_chancedurability_preservation_attributes:shield_durability_save_chancedurability_preservation_attributes:weapon_durability_save_chancedurability_preservation_attributes:projectile_durability_save_chancedurability_preservation_attributes:break_durability_save_chancedurability_preservation_attributes:use_durability_save_chanceEach attribute represents a chance from 0.0 to 1.0 to retain durability upon the usage of equipment:
0.0 = 0% chance to save durability0.25 = 25% chance to save durability1.0 = 100% chance to save durabilityWhat each attribute affects:
durability_save_chance: a global durability save chance added to every category belowarmor_durability_save_chance: armor durability loss when the player takes damageshield_durability_save_chance: shield durability loss when the player blocks damageweapon_durability_save_chance: durability loss when the player attacks a living entity with a damageable melee weaponprojectile_durability_save_chance: durability loss when the player uses projectile weapons such as bows and crossbowsbreak_durability_save_chance: durability loss from breaking blocks with damageable toolsuse_durability_save_chance: durability loss from using damageable items, such as flint and steel and other right-click style item usesThe global attribute is additive with the category-specific attributes.
Examples:
durability_save_chance = 0.10 and armor_durability_save_chance = 0.10 gives armor a total save chance of 0.20 (20% chance)durability_save_chance = 0.25 and break_durability_save_chance = 0.40 gives block breaking a total save chance of 0.65 (65% chance)The total cannot go over 1.0 (100% chance)
Minecraft's /attribute command can be used to set these values directly on a player.
General format:
/attribute <target> <attribute_id> base set <value>
Examples:
/attribute @s durability_preservation_attributes:durability_save_chance base set 0.10
/attribute @s durability_preservation_attributes:armor_durability_save_chance base set 0.20
/attribute @s durability_preservation_attributes:shield_durability_save_chance base set 0.35
/attribute @s durability_preservation_attributes:weapon_durability_save_chance base set 0.15
/attribute @s durability_preservation_attributes:projectile_durability_save_chance base set 0.50
/attribute @s durability_preservation_attributes:break_durability_save_chance base set 0.25
/attribute @s durability_preservation_attributes:use_durability_save_chance base set 0.40
You can also read the current value:
/attribute @s durability_preservation_attributes:break_durability_save_chance get
And reset a value back to zero:
/attribute @s durability_preservation_attributes:use_durability_save_chance base set 0.0
This mod is server-authoritative and event-driven.
ItemStack, letting vanilla or modded logic run, and then restoring the original damage value if the durability-save roll succeeds.durability_save_chance plus the relevant category-specific attribute, and the combined result is clamped to the 0.0 to 1.0 range.The mod is designed to work correctly on servers.
The mod is written to work with vanilla items and with modded items that use the normal NeoForge or vanilla durability paths.
This includes most modded:
Important compatibility note:
If another mod bypasses normal durability hooks and directly mutates item damage entirely in custom code, no event-based compatibility layer can guarantee interception. In practice, items that follow standard Minecraft or NeoForge behavior should work correctly.
The mod is lightweight by design.
For normal gameplay, performance impact should be minimal.