I'm in exam time right now but this question will be fast to answer :
in 1.15 and older, you can not modify player data, because the game does not support that, as you figured out (I didn't studied 1.16 yet). It's somewhat annoying because in order to modify ender items, you have to modify the player's data.
The only thing that can modify enderchest is the replace function : /replaceitem, for example, although you can only modify an enderchest slot, but not the content of an item already inside.
Looks like you can not do what you want...
...But that's not the case!
I see you are testing the shulker box in the enderchest's slot #0. So, here are 5 commands that will solve your problem :
execute at @a run setblock ~ 0 ~ minecraft:shulker_box execute as @a at @s run data modify block ~ 0 ~ Items set from entity @s EnderItems[{Slot:0b}].tag.BlockEntityTag.Items execute at @a run data modify block ~ 0 ~ Items append value {id:"minecraft:stone",Count:1,Slot:5b} execute as @a at @s run loot replace entity @s enderchest.0 1 mine ~ 0 ~ execute at @a run clone ~ 0 ~1 ~ ~0 ~1 ~ 0 ~
Here's a bit how it works :
- The first command setblocks a shulker box at player position, but layer 0
- The second copies the items in the enderchest (slot 0b)'s shulker box into the placed shulker box
- The third adds a stone into the new shulker box
- The fourth "loots" the shulker box into the enderchest's slot 0b (meaning it replaces the slot by what you get when mining the shulker box, so the one with added stone)
- The fifth replaces the shulker box (clones the layer-0 block type so changing nothing, no matter in what dimension / modified world)
You just have to modify the third command by your needs.
So no, you can not directly modify the content in a shulker box placed into an enderchest.
However, you can copy the shulker box in the world, modify it, then put it back into enderchest, which works fine (must test if 2 players are at the same coords)
I guess it's shulker time for me : I also used shulker loot trick for a potion stacker datapack and a friend's sethome-eggs datapack
1
You can use the clone command to do that :
But there is a limit to how many blocks you can clone.
1
You can do that in only one command :
1
1
^ ^ ^ is about your point of view, for exemple, ^ ^1 ^1 aims at 1 block away and 1 block above your point of view. Note that it start at your feet, if you want iit to start at your eyes, you have to add "execute anchored eyes run [command]"
1
If you want to know which player has left the area, you can add a tag to all players who are in the area, and check every tick if they still are in :
1
Oh well, in that case, you can write :
1
You can even just write :
1
You have to tell it where to find silent.json
just like when you have to run a function.
1
It's because in the repeat command block, @s mean nothing. @s mean "the entity who run the command" and here, it's the command block who run the command, and it doesn't have a scoreboard. For your scoreboard, you have to change the @s to @p (nearest player) or your minecraft name.
1
You just have to do this :