The simplest way to do this is to break the chest using a setblock command and teleport the dropped items to the specified player, followed by replacing the chest. This of course can be tweaked depending on what you’re trying to accomplish.
How do you give enchanted items commands?
You can set up some simple commands with command blocks, and let players click the button of each command block so that they receive the enchanted items. This is the general command: /give @p 0 {ench:[{id:<0-62>,lvl:<1-32767>},{id:<0-62>,lvl:<1-32767>},…]}
How do you give a player a command block?
Command blocks to give items
- To get a command block, at the command line type, “/give @p 137” into the in-game chat.
- In the command block enter, “/give @p 3420 1 5”.
- Then place another block over the command block with a button that will trigger it. Each time the student presses the button they get a beginner turtle.
How to give player an item using player?
Gives the player 1 Emerald. Please note this script will work on the Damaged, Killed, Attack and Target Hooks, but you’d first have to check if the appropriate target for each Hook is a player, and then use that object in place of the “player” variable. Community content is available under CC-BY-SA unless otherwise noted.
How to make the player choose from a specific list?
To make the player choose from a specific list of items, use the following script: This method returns the ID of the chosen item (or -1 if the choice was cancelled). The second argument (the number 1 here) is the Game Variable in which the returned value is stored (in addition to the method itself returning that value).
How do you give an item in Minecraft?
Gives an item to one or more players. Specifies the target (s) to give item (s) to. Must be a player name, a target selector or a UUID [ Java Edition only] . And the target selector must be of player type. Specifies the item to give. In Java Edition, it must be an item argument (does not accept item tags).
How can I manipulate items in the game?
This page describes how to manipulate items in the game, including how to give/take items, count how many of an item a player has, check what kind of item an item is, and so forth. There are three ways to give the player an item: