mojira.dev
MC-187015

Using an item and quickly switching hotbar slots doesn't reduce the durability of the said item

The Bug:

Using an item and quickly switching hotbar slots doesn't reduce the durability of the said item.

Steps to Reproduce:

  1. Summon an iron golem by using the command provided below.

    /summon minecraft:iron_golem ~ ~ ~ {NoAI:1b}
  2. Clear your inventory and give yourself eight diamond swords by using the commands provided below.

    /clear @s
    /give @s minecraft:diamond_sword 8
  3. Switch to survival mode and hold any of the diamond swords.

  4. Hit the iron golem and as soon as you do this, switch to the empty hotbar slot.

  5. Repeat this process until the sword that you use to damage the iron golem doesn't take durability.

  6. Take note as to whether or not using an item and quickly switching hotbar slots doesn't reduce the durability of the said item.

Observed Behavior:

The durability of the said item isn't reduced.

Expected Behavior:

The durability of the said item would always be reduced.

Linked issues

Attachments

Comments 15

can confirm

Hey there!

This affects 20w46a.

Can confirm in 20w48a.

Can confirm in 21w03a.

Can confirm in 1.16.5.

5 more comments

Can confirm in 1.19 and 1.19.1 Pre-release 1.

Can confirm in 1.19.2.

[media]
TiredRedstoner

This still works in 23w05a.

Based on MC-258269 and MC-249911, this issue can also occur when using riptide tridents and quickly switching hotbar slots, so I've altered this report (MC-187015) to mention this since I believe it's the same core problem.

This seems to be fixed in 1.21.5. Both when using tridents and swapping items, and when switching swords

[media]

Marcus Winter

(Unassigned)

Confirmed

Platform

Normal

Player

1.15.2, 20w22a, 20w46a, 20w48a, 21w03a, ..., 1.19.4, 23w16a, 23w18a, 1.20.2, 1.21

Retrieved