The Bug:
Damaged items are fully repaired when losing very large amounts of durability.
Undamaged items losing the same amount of durability break instead, therefore introducing an inconsistency.
Steps to Reproduce:
Obtain a damaged diamond sword that loses a very large amount of durability with each hit and hold it in your main hand by using the command provided below.
/give @s minecraft:diamond_sword[minecraft:damage=1000,minecraft:weapon={item_damage_per_attack:2147483647}]Place down a cow using a spawn egg and switch to survival mode.
Hit the cow with the diamond sword.
Observe if the diamond sword breaks or is fully repaired.
Observed Behavior:
Damaged items are fully repaired when losing very large amounts of durability.
Expected Behavior:
Damaged items would break when losing very large amounts of durability.