sandstone-mc / sandstone

Sandstone | Next Generation Framework for Minecraft
https://sandstone.dev/
MIT License
174 stars 15 forks source link

NBT.stringify uses single quotes, while they can only be used in the outer part of the string. #133

Closed TheMrZZ closed 2 years ago

TheMrZZ commented 2 years ago

In Minecraft SNBT, " and ' are not interchangeable. For example, this works (full double quotes):

/give @s minecraft:diamond_sword{display:{Name:"[{\"text\":\"foo\"}]"}} 1

This also works (double quotes surrounded by single quotes):

/give @s minecraft:diamond_sword{display:{Name:'[{"text":"foo"}]'}} 1

This does not work (single quotes surrounded by double quotes):

/give @s minecraft:diamond_sword{display:{Name:"[{'text':'foo\\nbar'}]"}} 1