mojira.dev
MC-197737

Mobs summoned by the player with equipment continue to render the item if it's removed via command in the same tick

Mobs summoned by the player with the summon command with equipment continue to render the item if it's removed via command in the same tick.

Steps to reproduce:

  • place a command block with the command:

    /item replace entity @e[type=minecraft:zombie] weapon.mainhand with minecraft:air

    and set it to Repeat and Always Active

     

  • place a second command block with the command:

    /summon minecraft:zombie ~ ~1 ~ {HandItems: [{id: "minecraft:diamond", Count: 1b}], NoAI: 1b}
  • Activate the second command block with redstone

-> The diamond in the zombie's hand disappears as soon as the zombie spawns

  • Run the same command from the second command block as player

-> The diamond is still rendered despite being removed from the zombie's hand (Check with /data get)

  • Relog

-> The diamond is no longer rendered

Linked issues

Comments 26

Can confirm in 20w51a.

Here's the updated command usage for the first reproduction step:

/item replace entity @e[type=minecraft:zombie] weapon.mainhand with minecraft:air

Confirmed in 23w16a. A few notes:

  • The bug affects ArmorItems as well as HandItems.

  • The bug also occurs if an entity is summoned with the /execute summon subcommand and runs a function that removes its equipment on itself. For example, running the following command a bunch of times will eventually result in a pillager that visually appears to be wearing an ominous banner on its head, but in reality the banner isn’t actually there just like this report describes.

/execute summon minecraft:pillager run data modify entity @s ArmorItems[3] set value {}

winauer

(Unassigned)

Confirmed

Commands

1.16.2, 1.16.3, 1.16.4, 20w45a, 20w51a, ..., 1.20.6, 1.21, 1.21.1, 1.21.2, 1.21.3

Retrieved