Skip to main content
Updated commands for new /execute syntax.
Source Link
One 2 Many
  • 12.8k
  • 9
  • 52
  • 91

Note: This answer is now obsolete. The preferred method is to use the structure method. Please go and use it if you would prefer something that works better!


Note: This answer is now obsolete. The preferred method is to use the structure method. Please go and use it if you would prefer something that works better!

My planThe premise here is to:

Item Customization


To discourage use of this obsolete method, this list and its instructions has been moved to the post detailing the better structure method instead. Please go and read it, and if you still want to go through with this method, come back here afterwards.

Item Customization


 

To avoid repetition, this list and its instructions have been moved to my other answer detailing the new and improved method involving structures. Please go and read it, and if you still want to go through with this method, come back here afterwards.

Commands

Commands

Now let's create the command chain we'll be using. PlaceWe need to run four commands in order, so you should place down an impulse command chain of 4three command blocks.


But seriously, why would you want to go through with a method that is obsolete? Well, if you're reading this, guess you want to.


Choose the command chain that best suits you.

Consider using the structure method instead?

Note: The /execute command has a different syntax depending on whether the "Upcoming Creator Features" experimental toggle is enabled on your world. In the below command examples, the new syntax is provided below the old syntax.

  1. Tell the player to clone the chest to their position.

    execute @p[name=THE_PLAYER_TO_TARGET] ~ ~ ~ clone Tx Ty Tz Tx Ty Tz ~ ~ ~
    execute at @p[name=THE_PLAYER_TO_TARGET] run clone Tx Ty Tz Tx Ty Tz ~ ~ ~
    

    Replace Tx, Ty, and Tz with the template location in both coordinate specifications.

  2. Tell the player to set the block to air and destroy the chest.

    execute @p[name=THE_PLAYER_TO_TARGET] ~ ~ ~ setblock ~ ~ ~ air destroy
    execute at @p[name=THE_PLAYER_TO_TARGET] run setblock ~ ~ ~ air destroy
    
  3. Kill the chest.

    kill @e[type=item,name=chest]
    

Sources

Sources

Note: This answer is now obsolete. The preferred method is to use the structure method. Please go and use it if you would prefer something that works better!


My plan is:

Item Customization


To discourage use of this obsolete method, this list and its instructions has been moved to the post detailing the better structure method instead. Please go and read it, and if you still want to go through with this method, come back here afterwards.


 

Commands

Now let's create the command chain we'll be using. Place an impulse command chain of 4 blocks.


But seriously, why would you want to go through with a method that is obsolete? Well, if you're reading this, guess you want to.


Choose the command chain that best suits you.

  1. Tell the player to clone the chest to their position.

    execute @p[name=THE_PLAYER_TO_TARGET] ~ ~ ~ clone Tx Ty Tz Tx Ty Tz ~ ~ ~
    

    Replace Tx, Ty, and Tz with the template location in both coordinate specifications.

  2. Tell the player to set the block to air and destroy the chest.

    execute @p[name=THE_PLAYER_TO_TARGET] ~ ~ ~ setblock ~ ~ ~ air destroy
    
  3. Kill the chest.

    kill @e[type=item,name=chest]
    

Sources

Note: This answer is now obsolete. The preferred method is to use the structure method. Please go and use it if you would prefer something that works better!

The premise here is to:

Item Customization

To avoid repetition, this list and its instructions have been moved to my other answer detailing the new and improved method involving structures. Please go and read it, and if you still want to go through with this method, come back here afterwards.

Commands

We need to run four commands in order, so you should place down an impulse command chain of three command blocks.

Consider using the structure method instead?

Note: The /execute command has a different syntax depending on whether the "Upcoming Creator Features" experimental toggle is enabled on your world. In the below command examples, the new syntax is provided below the old syntax.

  1. Tell the player to clone the chest to their position.

    execute @p[name=THE_PLAYER_TO_TARGET] ~ ~ ~ clone Tx Ty Tz Tx Ty Tz ~ ~ ~
    execute at @p[name=THE_PLAYER_TO_TARGET] run clone Tx Ty Tz Tx Ty Tz ~ ~ ~
    

    Replace Tx, Ty, and Tz with the template location in both coordinate specifications.

  2. Tell the player to set the block to air and destroy the chest.

    execute @p[name=THE_PLAYER_TO_TARGET] ~ ~ ~ setblock ~ ~ ~ air destroy
    execute at @p[name=THE_PLAYER_TO_TARGET] run setblock ~ ~ ~ air destroy
    
  3. Kill the chest.

    kill @e[type=item,name=chest]
    

Sources

Swapped answers
Source Link
One 2 Many
  • 12.8k
  • 9
  • 52
  • 91

Instead of storingNote: This answer is now obsolete. The preferred method is to use the item in a chest,structure method. Please go and use it if you storewould prefer something that works better!


Original post

Your dreams aren't crushed quite yet. Although it inmay be true that NBT is inaccessible from commands, there is still a structure by savingworkaround for what you want to do!

Here's a 1×1 structurehandy workaround that consists of just airlets you give items with custom names and the item entitiesenchantments. So the step by step guide

My plan is:

  1. Throw item(s) on top of a structure block, savePlace the structure with entities (probably asitem you want to give in a 1×1×1 sized structure)chest.
  2. ChangeOn command, clone the structure blockchest to load modethe player's location.
  3. When activated, loadUse /setblock in destroy mode to destroy the structure atchest, causing it to drop all its items on the player's positionplayer.

Now that you know the plan, let's begin!

Step 1: Customize your itemItem Customization

 

So to doTo discourage use of this obsolete method, you're going to needthis list and its instructions has been moved to prepare your item in your inventorythe post detailing the better structure method instead. Please observe the following things thatgo and read it, and if you can do to prepare your item:

Properties that can be set/changed without using this method

You can set the following item properties in a direct command without havingstill want to usego through with this method:, come back here afterwards.

  • Default potion effects: Potions can be given as one of the default potions available in the Creative Inventory using data values.
  • CanPlaceOn and CanDestroy: If you want to give an item with these properties alone, you can simply use /give with the JSON components.

Properties you can set/change with this method

 

The following properties can be changed withinOnce you have prepared your item, place a template chest on the game using this method:ground and place your item inside.

  • Custom name: Take your item to an anvil. Use the anvil’s rename form to change the item name. Instead of using raw JSON text, use formatting codes to stylize the item name.
  • Some enchantments: Get an enchanted book and combine it with your item in an anvil. You may also use /enchant while holding the item in your main hand. You may not exceed the maximum enchantment level, and you may not enchant items that don't make sense with that enchantment (so no enchanting a fish with Knockback X), but you can use an NBT editor—see below.
  • Filled maps: To give a filled map with custom scale/regions/ to a player, get an empty map yourself, bring it to the region, and activate it. Then place the filled map in the chest. This method is also required to give an empty locator map, because the locator/non-locator data is stored in NBT.

Properties that require an NBT editor to be set/changed

Commands

The following properties can be changed through one-time use of an NBT editor. Follow these instructions to modify any of the below listed properties, and place the item inNow let's create the chestcommand chain we'll be using. The below commands will then work to givePlace an exact copy of the item, even with some properties changed, without requiring useimpulse command chain of an NBT editor ever again4 blocks.

  • Lore
  • Unbreakable (won't display on tooltip but still takes effect)
  • Enchantments that an anvil is unable to apply to an item

Properties you cannot set/change

 

These are item tags that exist in Java Edition, but the matching NBT tag in Bedrock Edition has not been discoveredBut seriously, or is nonexistent. Feel freewhy would you want to tinkergo through with the NBT tags in an editora method that is obsolete? Well, and if you can find any new NBT tagsyou're reading this, please comment so I can addguess you want to this post!.

  • Custom potion effects

Step 2: Create the setup

 

Next we need to createChoose the setup of structurescommand chain that best suits you. This is how:

To give item to a player

  1. Ensure you have positional coordinates shownTell the player to clone the chest to their position. If not, run this command in your chat:

    gameruleexecute showcoordinates@p[name=THE_PLAYER_TO_TARGET] true~ ~ ~ clone Tx Ty Tz Tx Ty Tz ~ ~ ~
    
  2.  

    Pick a block on the ground. Any block will do, as long as it is a full blockReplace (not bottom slab, not chest, not soul sandTx, etc.). Stand on itTy, and noteTz with the coordinates that are currentlytemplate location in your positionboth coordinate specifications.

  3. You need a structure void for this. TypeTell the following command in your chat:player to set the block to air and destroy the chest.

    giveexecute @s@p[name=THE_PLAYER_TO_TARGET] structure_void~ ~ ~ setblock ~ ~ ~ air destroy
    
  4. Place the structure void onKill the block of ground you picked in step 1chest.

    kill @e[type=item,name=chest]
    

To summon item on the ground:

  1. Throw the item that you have customized ontoClone the ground there toochest. Ensure it is in the same block as the structure void, not next to it

    clone Tx Ty Tz Tx Ty Tz Rx Ry Rz
    

    T: Template location.
    From this point, you have 5 minutes to complete the next stepR: Target location. Take too long and your items will disappear!

  2. RunSet the following commandchest to save the structure:air and destroy it.

    structure save <name: string> <from: x y z> <to: xsetblock yRx z>Ry trueRz diskair falsedestroy
    
     
  3. But replace the following items inKill the above command:chest.

    • Replace <name: string> with a memorable name for your structure. Do not forget it or else you will have to create another one without deleting the old one, taking up memory slowly. How wasteful!
    • Replace <from: x y z> with the X, Y, and Z coordinates that I told you to write down in step 1.
    • Replace <to: x y z> with the X, Y, and Z coordinates that I told you to write down in step 1. This means that you should have specified the same coordinates twice.
    kill @e[type=item, name=chest]
    
 

Step 3: Setup the commandsSources

Setting up the commands is the last thing we need to do before our setupWhile this trick is complete! Place down a single impulse command block that will activate to give our player the item.

That's righthandy, only one command is needed for this:

execute @p[name=target_player] ~ ~ ~ structure load <name: string> ~ ~ ~

Replace <name: string> with the name you saved your structure assadly, I cannot claim ownership of it. Don't rememberI discovered it? Now you have to go back to step 2 and create in a new structure without deletingmap in Minecraft: Education Edition, from the old one because you don't remember its nameWe Are the Rangers library. How wasteful!

Once you've set up this command block, runI saw it as part of a task in the map, and you should see thatwhile looking in the item entities are summoned right on top of you so you don't needcommands, it was too good to run and fetch themnot post here. HoorayThank you to the Minecraft Education Edition team at Microsoft for creating such awesome maps!

Instead of storing the item in a chest, you store it in a structure by saving a 1×1 structure that consists of just air and the item entities. So the step by step guide is:

  1. Throw item(s) on top of a structure block, save the structure with entities (probably as a 1×1×1 sized structure).
  2. Change the structure block to load mode.
  3. When activated, load the structure at the player's position.

Now that you know the plan, let's begin!

Step 1: Customize your item

So to do this, you're going to need to prepare your item in your inventory. Please observe the following things that you can do to prepare your item:

Properties that can be set/changed without using this method

You can set the following item properties in a direct command without having to use this method:

  • Default potion effects: Potions can be given as one of the default potions available in the Creative Inventory using data values.
  • CanPlaceOn and CanDestroy: If you want to give an item with these properties alone, you can simply use /give with the JSON components.

Properties you can set/change with this method

The following properties can be changed within the game using this method:

  • Custom name: Take your item to an anvil. Use the anvil’s rename form to change the item name. Instead of using raw JSON text, use formatting codes to stylize the item name.
  • Some enchantments: Get an enchanted book and combine it with your item in an anvil. You may also use /enchant while holding the item in your main hand. You may not exceed the maximum enchantment level, and you may not enchant items that don't make sense with that enchantment (so no enchanting a fish with Knockback X), but you can use an NBT editor—see below.
  • Filled maps: To give a filled map with custom scale/regions/ to a player, get an empty map yourself, bring it to the region, and activate it. Then place the filled map in the chest. This method is also required to give an empty locator map, because the locator/non-locator data is stored in NBT.

Properties that require an NBT editor to be set/changed

The following properties can be changed through one-time use of an NBT editor. Follow these instructions to modify any of the below listed properties, and place the item in the chest. The below commands will then work to give an exact copy of the item, even with some properties changed, without requiring use of an NBT editor ever again.

  • Lore
  • Unbreakable (won't display on tooltip but still takes effect)
  • Enchantments that an anvil is unable to apply to an item

Properties you cannot set/change

These are item tags that exist in Java Edition, but the matching NBT tag in Bedrock Edition has not been discovered, or is nonexistent. Feel free to tinker with the NBT tags in an editor, and if you can find any new NBT tags, please comment so I can add to this post!

  • Custom potion effects

Step 2: Create the setup

Next we need to create the setup of structures. This is how:

  1. Ensure you have positional coordinates shown. If not, run this command in your chat:

    gamerule showcoordinates true
    
  2.  

    Pick a block on the ground. Any block will do, as long as it is a full block (not bottom slab, not chest, not soul sand, etc.). Stand on it, and note the coordinates that are currently in your position.

  3. You need a structure void for this. Type the following command in your chat:

    give @s structure_void
    
  4. Place the structure void on the block of ground you picked in step 1.

  5. Throw the item that you have customized onto the ground there too. Ensure it is in the same block as the structure void, not next to it.
    From this point, you have 5 minutes to complete the next step. Take too long and your items will disappear!

  6. Run the following command to save the structure:

    structure save <name: string> <from: x y z> <to: x y z> true disk false
    

    But replace the following items in the above command:

    • Replace <name: string> with a memorable name for your structure. Do not forget it or else you will have to create another one without deleting the old one, taking up memory slowly. How wasteful!
    • Replace <from: x y z> with the X, Y, and Z coordinates that I told you to write down in step 1.
    • Replace <to: x y z> with the X, Y, and Z coordinates that I told you to write down in step 1. This means that you should have specified the same coordinates twice.

Step 3: Setup the commands

Setting up the commands is the last thing we need to do before our setup is complete! Place down a single impulse command block that will activate to give our player the item.

That's right, only one command is needed for this:

execute @p[name=target_player] ~ ~ ~ structure load <name: string> ~ ~ ~

Replace <name: string> with the name you saved your structure as. Don't remember it? Now you have to go back to step 2 and create a new structure without deleting the old one because you don't remember its name. How wasteful!

Once you've set up this command block, run it, and you should see that the item entities are summoned right on top of you so you don't need to run and fetch them. Hooray!

Note: This answer is now obsolete. The preferred method is to use the structure method. Please go and use it if you would prefer something that works better!


Original post

Your dreams aren't crushed quite yet. Although it may be true that NBT is inaccessible from commands, there is still a workaround for what you want to do!

Here's a handy workaround that lets you give items with custom names and enchantments.

My plan is:

  1. Place the item you want to give in a chest.
  2. On command, clone the chest to the player's location.
  3. Use /setblock in destroy mode to destroy the chest, causing it to drop all its items on the player.

Item Customization

 

To discourage use of this obsolete method, this list and its instructions has been moved to the post detailing the better structure method instead. Please go and read it, and if you still want to go through with this method, come back here afterwards.

 

Once you have prepared your item, place a template chest on the ground and place your item inside.

Commands

Now let's create the command chain we'll be using. Place an impulse command chain of 4 blocks.

 

But seriously, why would you want to go through with a method that is obsolete? Well, if you're reading this, guess you want to.

 

Choose the command chain that best suits you.

To give item to a player

  1. Tell the player to clone the chest to their position.

    execute @p[name=THE_PLAYER_TO_TARGET] ~ ~ ~ clone Tx Ty Tz Tx Ty Tz ~ ~ ~
    

    Replace Tx, Ty, and Tz with the template location in both coordinate specifications.

  2. Tell the player to set the block to air and destroy the chest.

    execute @p[name=THE_PLAYER_TO_TARGET] ~ ~ ~ setblock ~ ~ ~ air destroy
    
  3. Kill the chest.

    kill @e[type=item,name=chest]
    

To summon item on the ground:

  1. Clone the chest.

    clone Tx Ty Tz Tx Ty Tz Rx Ry Rz
    

    T: Template location.
    R: Target location.

  2. Set the chest to air and destroy it.

    setblock Rx Ry Rz air destroy
    
     
  3. Kill the chest.

    kill @e[type=item, name=chest]
    
 

Sources

While this trick is handy, sadly, I cannot claim ownership of it. I discovered it in a map in Minecraft: Education Edition, from the We Are the Rangers library. I saw it as part of a task in the map, and while looking in the commands, it was too good to not post here. Thank you to the Minecraft Education Edition team at Microsoft for creating such awesome maps!

deleted 99 characters in body
Source Link
One 2 Many
  • 12.8k
  • 9
  • 52
  • 91
  1. Throw item(s) on top of a structure block, save the structure with entities (probably as a 1×1×1 sized structure).
  2. Change the structure block to load mode.
  3. Whenever you need itWhen activated, /setblock a redstone block next toload the structure block (and remove it again a tick later)
  4. Teleport the item entities toat the playerplayer's position.
  1. Throw item(s) on top of a structure block, save the structure with entities (probably as a 1×1×1 sized structure).
  2. Change the structure block to load mode.
  3. Whenever you need it, /setblock a redstone block next to the structure block (and remove it again a tick later)
  4. Teleport the item entities to the player.
  1. Throw item(s) on top of a structure block, save the structure with entities (probably as a 1×1×1 sized structure).
  2. Change the structure block to load mode.
  3. When activated, load the structure at the player's position.
Source Link
One 2 Many
  • 12.8k
  • 9
  • 52
  • 91
Loading