0

I've been playing the Bedrock version of Minecraft on Switch and I'm trying to get a lever that can only be placed on a gold block this is what I entered in the command block:

/give @p lever 1 0 {CanPlaceOn:["Block_of_Gold"]}

After that it just says

Line 1 Column 2 Missing '}' or object member name

Can anyone tell me what I'm doing wrong?

  • 1
    It's not called "Block_of_Gold". Look at the wiki for block ID names. – Fabian Röling Jun 23 '18 at 18:23
1

As Fabian pointed out, the name for “Block of Gold” isn’t Block_of_Gold, it’s gold_block. Bedrock Edition uses JSON format, not NBT, so the command would be:

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

See this post for more information on using "can_place_on".

Source: Block of Gold on Minecraft Gamepedia

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.