The bug
Player data has been confirmed as something that should not be modifiable (see for example MC-120693). Yet this you can use /execute store
to modify parts of it.
I'm personally not against this, it's useful and I think it's restricted to a "safe" area. This report is more to get an answer on "is this intended or not?".
Affected tags
Affected is the tag
NBT key for items inside a player's Inventory
key, EnderItems
or SelectedItem
(not a saved tag, but see MC-121900) key.
How to reproduce
Run
/give @s stick{Test:1b}
Make sure the stick is in the most left slot in your hotbar
Run
/execute store result entity @s Inventory[0].tag.Test byte 5 run data get entity @s Pos[0]
Run
/data get entity @s Inventory[0].tag.Test
ā The
Test
tag indeed has the 5 times the X position of the player when the second command was ran as its value
Linked issues
relates to
Comments


Affects 1.13-pre6. I agree with @unknown's suggestion, adding a
/execute store <success|result> item
command would work lots better. It would also be nice to have
/data merge item

Confirmed for 1.13.1.

Confirmed for 18w43a.
Interestingly, /data modify does not allow targeting the tag tag in player inventories

I'm personally not against this, it's useful and I think it's restricted to a "safe" area. This report is more to get an answer on "is this intended or not?".
The problem with this is, if I remember it correctly, that there is no guarantee that the client is informed in time about the change. Therefore, if the tag
entry effects how the client can use the item, or how it is displayed, then the client may experience a desync.

1.14 Confirmed
Change the nbt in SeletecItem or Inventory unless the tag exist dosen't work.

Personally I find this functionality very useful and had up until now been considering it a feature. I would love to see it receive more support or possibly receive a more officially supported and feature complete way to edit player NBT, there are so many cool things that can be done with the ability to modify player data. And sadly execute store is still quite limited and specific another example

I suggest that the whole player data should be changeable by commands.

Dinnerbone has previously explained why they can't, and won't do that. TLDR; modifying NBT actually involves destroying and recreating the entity/block, and doing so for players would kick them from the server

It's interesting that you would say, "It can't be done without kicking the players from the server", cause I can confirm that data is being stored inside of Item tags so clearly it's not impossible...

That's only because the `tag` tag of items is different to most NBT, it is stored as actual NBT in memory, whereas other things such as `Pos` and `Motion` are not, they are stored in a different internal format

confirmed in 1.14.2, but maybe not five times of x pos.
[media]

@unknown What do you mean? This report has nothing to do with your X position. Also, that image is broken.

Iām really quite disappointed this bug was fixed with no alternative. Currently there are no other ways to modify item nbt inside player inventories, and as it stands a couple dozen of my own datapacks are now broken and completely unfixable.

Boq has stated there'll likely get an alternative after the feature freeze, go check out the r/minecraftcommands discord server, where it was said.

Well that's disappointing. This was very useful in coding data packs
This is a bug tracker, and not a discussion forum. If you want to discuss this change, please head over to somewhere else.

Specifically, here: https://www.reddit.com/r/Mojira/
That is the intended place for discussions about Minecraft bugs and the bugtracker.

@unknown Can you link that reference, please?
Suggestion for a fix:
Limit it to non-player entities and add
instead.