0

So I'm trying to detect when I'm wearing a unbreakable black leather boots with a lore, a name, and enchants. Here's the code:

/testfor @p {Inventory:[{Slot:100b,id:"minecraft:leather_boots",tag:{Unbreakable:1,display:{Name:"shadow sandals",Lore:[_____],color:0},ench:[{id:0,lvl:31073},{id:7,lvl:31073},{id:4,lvl:31073},{id:3,lvl:31073}]}}]}}}

But it says that it has unbalanced curly brackets, can someone help me fix this and give me the corrected command?

PS: The testfor is so when I wear the boots it will give me a potion effect.

7
  • @bearb001 Your edit to this question was not helpful, as the interface for specifying commands in minecraft only allows a single line of input. Additionally, it had the effect of invalidating my duplicate flag.
    – pppery
    Commented Jul 8, 2019 at 22:00
  • @pppery As I said in an earlier comment, I didn't know that editing the question would have that effect. I'm sorry. The edit did improve readability and it does help with troubleshooting, because it's much easier to see what is going on in the command and what is causing certain syntax errors. You can also still copy and paste it into a command block.
    – user232393
    Commented Jul 8, 2019 at 22:03
  • @bearb001 Yes, it does improve readability of the question, but in the process of doing so, it mangles the input into the command block. guest did not type line breaks into a command block in minecraft, as doing so is impossible. Your "improvement to readability" came at the expense of accuracy.
    – pppery
    Commented Jul 8, 2019 at 22:07
  • @pppery I don't see how the accuracy is reduced, the line breaks won't transfer over to the command block when copying and pasting, because, as you said, that's not possible. The only difference would be some extra spaces, which don't affect the command. Feel free to roll back the edit (or suggest to roll it back?) if you feel like that's the right thing to do.
    – user232393
    Commented Jul 8, 2019 at 22:10
  • @bearb001 done
    – pppery
    Commented Jul 8, 2019 at 22:14

2 Answers 2

2

You've got two extra curly brackets at the end. After the last square bracket closed Inventory, you only need 1 more curly bracket to end the tag:

/testfor @p {Inventory:[{Slot:100b,id:"minecraft:leather_boots",tag:{Unbreakable:1,display:{Name:"shadow sandals",Lore:[_____],color:0},ench:[{id:0,lvl:31073},{id:7,lvl:31073},{id:4,lvl:31073},{id:3,lvl:31073}]}}]}

The command should now work, if you're giving the boots with something like:

/give @p leather_boots 1 0 {Unbreakable:1,display:{Name:"shadow sandals",Lore:[_____],color:0},ench:[{id:0,lvl:31073},{id:7,lvl:31073},{id:4,lvl:31073},{id:3,lvl:31073}]}

Keep in mind however that id and lvl are shorts by default, and Unbreakable is a byte by default. This means that, if you've added the tags by another means, you should specify these types in your testfor command:

/testfor @p {Inventory:[{Slot:100b,id:"minecraft:leather_boots",tag:{Unbreakable:1b,display:{Name:"shadow sandals",Lore:[_____],color:0},ench:[{id:0s,lvl:31073s},{id:7s,lvl:31073s},{id:4s,lvl:31073s},{id:3s,lvl:31073s}]}}]}
2
  • thx a lot XD really helped me
    – guest
    Commented Sep 1, 2016 at 16:53
  • @guest No problem, press the tick to the left of the answer to accept it if it worked for you.
    – SirBenet
    Commented Sep 1, 2016 at 17:07
0

You have too many curly braces ( } ). Try:

/testfor @p {Inventory:[{Slot:100b,id:"minecraft:leather_boots",tag:{Unbreakable:1,display:{Name:"shadow sandals",Lore:[_____],color:0},ench:[{id:0,lvl:31073},{id:7,lvl:31073},{id:4,lvl:31073},{id:3,lvl:31073}]}}]}
3
  • thx, really helped
    – guest
    Commented Sep 1, 2016 at 16:54
  • Here's a tip: Use the "`" character to separate your command from everything else (surround command in them). It makes your answer a lot more readable!
    – Daniel G
    Commented Sep 2, 2016 at 0:00
  • 1
    @DanielG That character is primarily for inline code, while a lengthy command on its own line would use a code block (4 spaces).
    – Skylinerw
    Commented Sep 2, 2016 at 0:58

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