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?


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.

|improve this answer|||||
  • 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 '15 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 '15 at 8:37

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.