Item components

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

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[edit | edit source]

can_place_on[edit | edit source]

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[edit | edit source]

Controls what block types this item can destroy.

item_lock[edit | edit source]

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[edit | edit source]

the texture used over the item.

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

lock_in_slot[edit | edit source]

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[edit | edit source]

Prevents the item from being dropped when the player dies.

Examples[edit | edit source]

/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[edit | edit source]

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

References[edit | edit source]

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

Navigation[edit | edit source]