Minecraft Bedrock Edition – Using NBT Tags in Commands

minecraft-bedrock-editionminecraft-commands

This question was recently split into different questions for each workaround. See these two meta posts for more information.


Can you use NBT tags in commands? I’ve tried commands that normally work in Java Edition like:

give @s minecraft:planks 30 1 {display:{Lore:["Wooden planks"]}}
give @s stone_pickaxe{Unbreakable:1b}
give @s item_frame{EntityTag:{Invisible:1b}}
summon villager ~ ~ ~ {Offers:{Recipes:[{buy:{id:"emerald",Count:5b},sell:{id:"diamond_sword"}}]}}
summon tnt ~ ~ ~ {Fuse:20s}

Best Answer

If your question was marked as a duplicate of this one, it means your NBT question is not solvable in Bedrock Edition.


Unfortunately, there is no access to NBT tags from commands in Bedrock Edition (formerly Pocket Edition), so this is not possible. There are some workarounds for specific use cases:

Here are some examples of things that are currently impossible in Bedrock Edition:

  • Giving a potion with a custom effect
  • Placing skulls with custom owners
  • Adding attribute modifiers to items
  • Detecting items in a certain item slot
    • There is a way to detect the item the player is holding using behavior packs, animations and MoLang queries, which is too complicated to explain here. Look at the vanilla player animation controller file for an example.
  • Summoning a tipped arrow
  • Summoning invisible item frames
  • Summoning horses with custom speed/jump height/health
  • Changing the time until a TNT explosion
  • Referencing NBT in /clear (note that you can still use data values)
  • Detecting when a mob is at a certain health
  • Referencing JSON files in commands