Is there any other way to put items from a container into a player's inventory?

like i know the minecart way, but the problem with it is just the fact that you can steal the items if you joined the server before the player who is actually supposed to have the items if ur close enough, and like im recreating the like legacy battle minigame using a datapack right so that's why i need it because in that mode when you pressed a keybind when you had the chest open you like got all the items in it if you had the space, basically I need another way to get items from a chest into a specific player's inventory and I can't think of any others than this one
Continue to help post