mojira.dev
MC-205649

Modifying a held item via /enchant, /item modify or /loot replace plays the item bob animation in first-person mode

Modifying a held item via /enchant, /item modify or /loot replace plays the item bob animation if the player is in first-person mode. It is expected that this animation would only play when the attack timer resets or the item is swapped for a different one.

This is a major issue for datapacks which rely on updating a player’s held item, eg. to change an item’s enchantments or enchantment glint, because it suggests to the player that their attack timer has reset even though it hasn’t.

To reproduce

  1. /give @s wooden_sword
  2. Hold the sword

  3. /enchant @s sharpness 2

    ❌ Notice how the item moved up and down in your hand

Note

The original reporter indicated that previously, an animation would also play in the hotbar, along with the item pick-up sound, however as of at least 25w10a (and probably much earlier) this no longer seems to be the case.

Linked issues

Attachments

Comments 6

Amos Lastmann

Confirmed for 20w48a

Amos Lastmann

By the way the attachment is a json I made for testing, so if you shove it in an empty datapack you can still quickly test for or look at the bug.

CivetKitty

My suggestion for fixing this is to never show the item bringing up animation unless the player is 

a. scrolling slots,

b. pressing F (offhand swapping), and 

c. repairing damaged items using the mending enchantment. 

Amos Lastmann

And... The glitch is even worse than I thought... I usually don't play with sound but when I did it made this aweful buzz each time someone held an item to be replaced, with both versions 1.16.4 and with the new item command in 1.17 snapshots

clamlol

As of 25w10a I don’t get the sound, just the animation, which is the main issue (because players often assume that the item bob animation is tied to the attack timer).

Loupieur

And armors make the equip sound too, Idk if it’s normal, but it’s ennoying if we want to change always the items

clamlol

(Unassigned)

Confirmed

Platform

Normal

Commands, Player Animation

command, datapacks, sound, visual-bug

1.16.4, 20w46a, 20w48a, 20w49a, 20w51a, 1.16.5, 21w08b, 1.17, 25w10a, 1.21.6 Pre-Release 1

Retrieved