2

This question already has an answer here:

I am working on an adventure mode map on the Nintendo Switch Bedrock Edition, and so I am trying to give myself a diamond pickaxe which can only break mob spawners and is unbreakable. I have currently:

/give @s diamond_pickaxe 1 0 {CanDestroy:["minecraft:mob_spawner"],Unbreakable:1}

and whenever I enter the command I get:

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

I have gone off of a couple tutorials and this is the closest I can get to having it work.

Can anyone please tell me where the error is?

marked as duplicate by Virusbomb, user232393, Schism, dly, greg-449 Jul 9 at 6:33

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    My current theory is that this is a difference between Java Edition and Bedrock Edition NBT format. I'll have to look at this a little deeper at home, and maybe do some testing on my Windows 10 install. – Unionhawk Feb 19 at 21:00
1

The command you're using is pre-1.13 synax. The command for 1.13 is:

/give @s diamond_pickaxe{CanDestroy:["list of blocks you want the pick to destroy here"],Unbreakable:1b} 1

You can view all 1.13 command changes here: https://minecraft.gamepedia.com/1.13#Command_format_2

  • While this is actually not very helpful for my situation it did lead me to figure it out. – Peregrine Lennert Feb 20 at 0:05
1

Alright, thank you @SpiceWeasel for indirectly helping me figure out the issue. There is no NBT data with the give command on bedrock edition.

  • Ah, Bedrock Edition. The fine print I always miss :P – SpiceWeasel Feb 20 at 0:57

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