mojira.dev
MC-279406

Items with weapon component and full durability don't reduce durability when attack something

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:

  1. 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]
  1. Attack any entities like Armor Stand by using them.

  2. 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.

 

Linked issues

Comments 2

This issue relates to, or may duplicate MC-269654.

Yes it's a duplicate; your iron ingot has no damage component; iron swords have it by default.

wplxfore

(Unassigned)

Unconfirmed

(Unassigned)

25w02a

Retrieved