Item Components JSON NBT | Minecraft Bedrock Command Help | /give /replaceitem NBT Components
Описание
/give and /replaceitem have special features that not alot of people know about. These things are NBT Components. In the /give and /replace item syntax they have a augment called components as type JSON. These components are actually super simple to understand. JSON formatted. Like NBT tags but supports only minecraft:can_place_on, minecraft:can_destroy, minecraft:item_lock and minecraft:keep_on_death functions.
NBT data for the Bedrock edition is minimal. The only values we have access to are:
CanPlaceOn
CanDestroy
KeepOnDeath
ItemLock.
These are used as part of a /give or replaceitem command and can edit specific properties of the items with said NBT.
Destroy: /give @p diamond_pickaxe 1 0 {"minecraft:can_destroy":{"blocks":["planks", "skull"]}}
Place on: /give @p stone 1 0 {"minecraft:can_place_on":{"blocks":["stone"]}}
Lock in any applicable slot in inventory: /give @p iron_axe 1 100 {"minecraft:item_lock":{ "mode": "lock_in_inventory" }}
Lock in a specific slot in inventory: /give @p apple 1 0 {"minecraft:item_lock":{ "mode": "lock_in_slot" }}
Item will remain in an entity's inventory when it dies: /replaceitem entity @e[type=zombie] slot.weapon.mainhand -1 cooked_beef 1 0 {"minecraft:keep_on_death":{}}
Give all players a bow that locks in a specific inventory slot and is kept on death: /give @a bow 1 0 {"minecraft:item_lock":{ "mode": "lock_in_slot" }, "minecraft:keep_on_death":{}}
Give self a stone shovel that can only dig up gravel and sand, and locks in inventory: /give @s stone_shovel 1 0 {"minecraft:can_destroy":{"blocks":["dirt", "sand"]},"minecraft:item_lock":{ "mode": "lock_in_inventory" }}
Assigning specific blocks and items with specific data values using "minecraft:can_place_on" and "minecraft:can_destroy" will return an error stating the NBT "could not be updated, which seems to be an unintended bug in this case.
/give @s cobblestone 64 0 {"minecraft:can_place_on":{"blocks":["stained_glass:2"]}}
/give @a wooden_axe 16 0 {"minecraft:can_destroy":{"blocks":["wool:5"]}}
Similarly to the issue above, specifying commands that generally do not make sense will also return a "could not be updated" error. Some examples include:
/give @a diamond 10 0 {"minecraft:can_place_on":{"blocks":["dirt"]}}
VIDEO AND DESCRIPTION COMMANDS ARE FROM: bedrock.dev:
https://wiki.bedrock.dev/commands/nbt-commands.html
Join this channel to get access to perks:
https://www.youtube.com/channel/UCbtRgldllSHEG7CnVp_04DQ/join
Рекомендуемые видео


















