mojira.dev
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

Linked issues

Comments 19

Suggestion for a fix:
Limit it to non-player entities and add

execute store <success|result> item <(block <x> <y> <z>)|(entity <selector>)> <slot> <path> <data-type> <scale> ...

instead.

CreeperMagnet_

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.

9 more comments

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?

Pepijn96

boq

Confirmed

Commands

/execute, /execute-store, player, player-data

Minecraft 17w50a, Minecraft 18w02a, Minecraft 18w03a, Minecraft 18w03b, Minecraft 18w05a, ..., Minecraft 1.13, Minecraft 18w31a, Minecraft 1.13.1, Minecraft 18w43a, Minecraft 1.14

19w37a

Retrieved