misode / misode.github.io

Data Pack Generators and Tools for Minecraft 1.15, 1.16, 1.17, 1.18, 1.19, 1.20, 1.21
https://misode.github.io/
MIT License
491 stars 68 forks source link

SNBT output type should utilise single-quotes when string contains double-quotes #548

Open DorkOrc opened 2 weeks ago

DorkOrc commented 2 weeks ago

For example, this predicate (once #547 is fixed) outputs this:

{
  condition: "minecraft:entity_properties",
  entity: "this",
  predicate: {
    equipment: {
      mainhand: {
        components: {
          "minecraft:custom_name": "{\"text\":\"Test\",\"color\":\"red\"}"
        }
      }
    }
  }
}

But line 8 could instead be '{"text":"Test","color":"red"}' as shown in /data get and in general prefered as it's more readable.