Item components

For the format of item components in Java Edition, see Data component format.
This feature is exclusive to Bedrock Edition.
 

Item components are JSON formatted like data components 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. this allows blocks to be placed in adventure mode without the use of Allow blocks

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

the texture used over the item.

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

lock_in_slot

the texture used over the item.

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"}}

Every component is listed on Data component format.

Issues

  • 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.

Navigation