ScriptCraft

ScriptCraft

14.6k Downloads

‘ and “ in server.dispatchCommand strings

nanocodex opened this issue · 3 comments

commented

Is it possible to execute a server command with both the ‘ and “ symbols in the string?
Example :
/give @p minecraft:piston{display:{Name:'{"text":"Text Here","color":"gray","underlined":true}',Lore:['[{"text":"More ","color":"dark_red","bold":false},{"text":"Text ","color":"dark_blue","strikethrough":true},{"text":"Here","color":"reset"}]']}} 1

commented

The last time I tried doing that, it returned an error, I’ll have to try it again to see if it actually works or not.

commented

Yes, you choose either " or ' as your quote symbol, and then escape the other one

"This string's content contains a mix of \" and ' characters. The \" symbol has to be escaped with a \\ character."
commented

Yep, it works.