Minecraft Bedrock Edition: Give lever that can only be placed on a specific block [duplicate]

Solution 1:

This is the proper command syntax for MCPE:

/give @p lever 1 0 {"can_place_on":{"blocks":["gold_block"]}}

You can change the block or placeable item after the /give @p lever but it has to be a placeable item.

Also changing the block or adding more do this:

  • To change the block you want to place it on, just change the string inside the square brackets after {"blocks":["**this string here**"]}}.

  • Adding more blocks:

    /give @p lever 1 0 {"can_place_on":{"blocks":["gold_block", "iron_block"]}}