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
is duplicated by 4
relates to 1
Comments 26
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 {}
Can confirm in 20w51a.