Java Edition has the CanPlaceOn
and CanDestroy
NBT tags, which are used to restrict the blocks an item can be placed on and destroy respectively (in adventure mode). For example, the following commands give the player a stone block that can only be placed on grass and dirt, and a netherite axe that can only destroy pumpkins:
give @s stone{CanPlaceOn:["minecraft:grass","minecraft:dirt"]}give @s netherite_axe{CanDestroy:["minecraft:pumpkin"]}
How can I do this in Bedrock Edition?
Browse more workarounds for getting/setting NBT in Bedrock Edition