mojira.dev
MC-102709

Mobs cannot receive shields in mainhand with /replaceitem

When trying to use the replaceitem command to give mobs shields in the slot.weapon.mainhand slot, the command fails. Tried this on both skeletons and zombies, does not work. However, the command does work on players.
This is a bug exclusive to 16w21a onwards, probably due to the changes with dispensers now auto-equipping shields to a mob's offhand.
I tried this on multiple worlds, doesn't seem to be specific to the one I was using earlier. I summoned a Zombie, then ran the command /replaceitem entity @e[type=Zombie,r=5] slot.weapon.mainhand minecraft:shield whilst standing right next to the zombie. The game then displays "Could not replace slot slot.weapon.mainhand with 1 * [Shield]".

Linked issues

Comments 2

This site is for bug reports only. For feature suggestions or changes please see: Minecraft Suggestions on Reddit.

Please provide the exact commands you used. It works fine for me.

JABrules

Erik Broes

Confirmed

Minecraft 16w21a, Minecraft 16w21b

Minecraft 1.10 Pre-Release 2

Retrieved