Minecraft – Quotes ignore brackets

minecraft-commandsminecraft-java-edition

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?

Best Answer

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.