How to give myself a custom item in Minecraft Education Edition? [duplicate]
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:
- Giving one of the default potions from the Creative Inventory (no custom effects)
-
Giving an item with properties (click link to see available/unavailable properties)
-
Using an NBT editor to modify normally unavailable item properties
Can be used to obtain enchantments that exceed their maximum enchantment level.
-
Using an NBT editor to modify normally unavailable item properties
- Using CanPlaceOn and CanDestroy
- Detecting whether a player has an item in their inventory
- Getting a block with data to place yourself
- Setting a block with data in a certain position
- Summoning a charged creeper
- Summoning a named mob
- Summoning a baby mob
- Summoning a villager with a certain profession
- Testing for a certain dropped item
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
This is only possible for giving potions, using CanPlaceOn
and CanDestroy
, and the {powered:1}
section of the creeper, although the syntax is slightly different. Based on other answers here, we know that it is impossible to add NBT tags in Bedrock Edition. However, there are loopholes for the items above.
For the potion, we'll use the data integer of 5, meaning Night Vision for 3 minutes. Link here: https://www.digminecraft.com/generators/give_potion_pe.php
/give @p potion 1 5
Here is a table of the possible values:
For the stone, we can use JSON components for the abilities to place on certain items. This only works in adventure mode.
/give @s minecraft:stone 1 0 {"minecraft:can_place_on":{"blocks":["minecraft:grass","minecraft:dirt"]}}
Finally, for the powered creeper, we can utilize spawn events to make this possible in Bedrock Edition.
/summon creeper ~ ~ ~ minecraft:become_charged
I hope this helps!