Mojira Archive
MC-123307

'/execute store' can modify player data inside item "tags" of their Inventory or EnderItems

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

  1. Run
    /give @s stick{Test:1b}
    
  2. Make sure the stick is in the most left slot in your hotbar
  3. Run
    /execute store result entity @s Inventory[0].tag.Test byte 5 run data get entity @s Pos[0]
    
  4. 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