Swords, axes,etc can reduce their durability when attacking something, So any items with weapon components should also be like this. But it doesn't apply to other items with full durability.
How to Reproduce:
Run these command:
/give @s minecraft:iron_ingot[minecraft:max_stack_size=1,minecraft:max_damage=100,minecraft:weapon={}] /give @s minecraft:gold_ingot[minecraft:max_stack_size=1,minecraft:max_damage=100,minecraft:weapon={},minecraft:damage=1] /give @s minecraft:iron_sword[minecraft:max_stack_size=1,minecraft:max_damage=100,minecraft:weapon={}] /give @s minecraft:iron_sword[minecraft:max_stack_size=1,minecraft:max_damage=100,minecraft:weapon={},!minecraft:tool]
Attack any entities like Armor Stand by using them.
Check the change of durability.
Expected Result:
All of them should reduce their durability.
Observed Result:
Iron sword and gold ingot can reduce but iron ingot is not.
This issue relates to, or may duplicate MC-269654.