Minecraft Wiki
Advertisement
Information icon
This feature is exclusive to Bedrock Edition. 

JSON formatted. Like NBT tags but supports only minecraft:can_place_on,minecraft:can_destroy,minecraft:item_lock and minecraft:keep_on_death functions.

Component Types[]

can_place_on[]

Controls what block types this block may be placed on.

can_destroy[]

Controls what block types this item can destroy.

item_lock[]

Locks the item in the player's inventory. Has a parameter mode that specifies the type of lock. It must be one of lock_in_inventory or lock_in_slot.[1]

lock_in_inventory[]

Prevents the item from being removed from the player's inventory, dropped, or crafted with.

lock_in_slot[]

Prevents the item from being moved or removed from its slot in the player's inventory, dropped, and by extension, crafted with.

keep_on_death[]

Prevents the item from being dropped when the player dies.

Examples[]

/give @p netherite_shovel 2 0 {"minecraft:can_destroy":{"blocks":["grass"]},"minecraft:item_lock":{"mode":"lock_in_slot"}}

/give @p netherite_pickaxe 1 0 {"minecraft:keep_on_death":{}}

/replaceitem entity @s slot.hotbar 0 concrete 1 0 {"minecraft:can_place_on":{"blocks":["grass"]}}

/replaceitem entity @s slot.weapon.mainhand 0 spawn_egg 64 110 {"minecraft:item_lock":{"mode":"lock_in_inventory"}}

Issues[]

  • Can only be applied to blocks.
  • Can not differentiate blocks by Data ID.
  • Can only be used with /give and /replaceitem.

References[]

  1. "Minecraft - 1.16.100 (Bedrock)" – Minecraft Feedback, November 16, 2020.
Advertisement