mojira.dev
MC-296199

player equipment nbt missing mainhand

mainhand is missing/omitted in player equipment NBT.

Observed results:
The command /data modify entity @n[type=zombie] equipment set from entity @s equipment copies armor items and offhand item, excluding the mainhand weapon.

Expected behavior:
All equipment worn/held equipment is copied to the mob.

Linked issues

Comments 3

From the 1.21.5 changelog:

Equipment Data

  • The ArmorItems, HandItems, and body_armor_item fields have been merged into an equipment field

    • Format: map between equipment slot type and item stack

      • Valid equipment slots: head, chest, legs, feet, mainhand, offhand, body, saddle

    • If not specified or removed, the entity will have no equipment

    • e.g. equipment:{chest:{id:'minecraft:diamond_chestplate'}}

    • This affects all mobs and Armor Stands

    • The armor and off-hand equipment of Players is now also stored in the equipment field (although items written into the Inventory using armor and off-hand slot numbers still work)

The last line probably means that mainhand is not supposed to be stored in players.

Yeah this is probably intended, it isn’t really desirable to duplicate the item already stored in Inventory.

Thank you for your report!
After consideration, the issue is being closed as Working as Intended.

Please note, that mechanics of the game may change between updates.
Things such as graphics, sounds, world creation, biomes, redstone, villagers, and animals may not work the same in current versions.

Full Version History – Snapshot Version History – The official Minecraft feedback site

Quick Links:
πŸ““ Bug Tracker Guidelines – πŸ’¬ Community Support – πŸ“§ Mojang Support (Technical Issues) – πŸ“§ Microsoft Support (Account Issues)
πŸ““ Project Summary – ✍️ Feedback and Suggestions – πŸ“– Game Wiki

knirch

(Unassigned)

Confirmed

(Unassigned)

1.21.5

Retrieved