I have tried to copy all items from a player's inventory into a chest in 1.16. I have used this command for the hot bar and the 2 first rows in the inventory:
/data modify block 227 76 77 Items set from entity @a[tag=inbuild,limit=1] Inventory
For the 3rd row I have used these commands:
/summon minecraft:item ~ 69.00 85.46 {Item:{id:"minecraft:stone",Count:1b},Age:5990s}
execute store success score itemdetect CopyInv run data modify entity @e[y=69.00,z=85.46,distance=0..1,type=item,limit=1,sort=nearest] Item set from entity @a[tag=inbuild,limit=1] Inventory[{Slot:35b}]
execute if score itemdetect CopyInv matches 1 run data modify block 227 76 79 Items[{Slot:8b}] merge from entity @e[y=69.00,z=85.46,distance=0..1,type=item,limit=1,sort=nearest] Item
It works, but now I need to do the same with the armor slots and the second hand but i cant get it to work :( Do I need to do something else to get the armor and the second hand to work, or am I just using the wrong slot IDs? For the armor i use these ids: 100
, 101
, 102
and 103
, and for the second hand i use this -106
. I can have missed something else when I did it, but I have done it 3 times and I never got it to work!
I'm playing in 1.16 (pre-release 5)