2

I'm playing Minecraft in Windows 10 edition and I type

/give @s gold_block 1 0 {CanPlaceOn:["minecraft:planks"]}

in-game chat but I keep getting the response,

Line 1, Column 2 missing '}' or object member name 

I've tried looking up people answering this question but nothing is helping me solve this problem. What can I do to get this command to work or at least get this block with those features.

FYI, I'm pretty sure this command works in my version because the can_destory command does.

1
0

The correct command is:

/give @s gold_block 1 0 {"can_place_on":{"blocks":["minecraft:planks"]}}

It needs to be in quotes, underscore-separated words instead of camel cased, and in an array called blocks.

0

Item properties are formatted as JSON (JavaScript Object Notation). Therefore, make an object called "can_place_on" with an array "blocks" with all the blocks you want to place it on.

The command would look like this:

/give @a <block> 1 0 {"can_place_on":{"blocks":["<block1>","<block2>"]}}

Example

Here’s an example. You will receive one redstone torch that can be placed on a stone block:

/give @a redstone_torch 1 0 {"can_place_on":{"blocks":["minecraft:stone"]}}

Hope that helped!

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