mojira.dev
MC-297448

equipment nbt on players contains all equipment except for the mainhand

If you run a data get equipment command you can see that it contains every item equiped except for the item in mainhand.

If a player is holding an iron sword in their mainhand and a shield in their offhand, when you run /data get entity @s equipment you will get the following output: {offhand: {count: 1, id: "minecrafT:shield"}} which does not contain the iron sword in the mainhand.

Linked issues

Attachments

Comments 3

From the 1.21.5 changelogs:

  • 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)

This means that main hand equipment is not stored.

Ok thanks, although it's still weird that when you do have an item in your mainhand the equipment field shows up as empty brackets instead of the error message.

If you don't know what I mean then look at the images I attached.

Thank you for your report!
We are tracking this issue in MC-296199, so this ticket is being resolved and linked as a duplicate.

That ticket has already been resolved as Works As Intended, which means this is not considered a bug and will not be fixed. Please do not leave a comment on the linked ticket.

If you haven’t already, please make use of the search feature to see whether an issue has already been reported.

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

ElLuxor89

(Unassigned)

Unconfirmed

(Unassigned)

1.21.5

Retrieved