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
is duplicated by 1
relates to 3
Comments 19
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 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.
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.
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.
Suggestion for a fix:
Limit it to non-player entities and add
instead.