2

I am trying to place a sign to copy the use of Essentials' [Buy] Command, using this command:

/setblock ~ ~1 ~ wall_sign 5 replace {id:Sign,Text1:"[Buy]"}

But that command gives me this when it is executed

It seems as if even though the brackets are in Quotes, the command is seeing them as an exectuable string. Is there a way to bypass this?

1 Answer 1

1

I ended up using a work-around. Apparently /blockdata Doesn't ignore brackets in quotes. So instead of the /setblock I used

/blockdata ~ ~-1 ~ { Text1: "{ text:\"[Buy]\", color:dark_blue,clickEvent: { action:run_command, value:\"/setblock ~-2 ~ ~ redstone_block\" } }",Text2:"All Purchases",Text3:"Are Non-", Text4:"Refundable!"} 

To make the sign.

2
  • Maybe you could explain why square brackets don't work without the `` slashes. (Clue: It's something to do with json arrays)
    – aytimothy
    Oct 15, 2015 at 22:27
  • No need to use blockdata. The real change that made it work was to switch from the simple Text1:"[Buy]" to a full composite JSON: Text1:"{text:\"[Buy]\"}" (which you need anyway to make it do stuff).
    – MrLemon
    Oct 16, 2015 at 8:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .