misode.github.io icon indicating copy to clipboard operation
misode.github.io copied to clipboard

You can't import JSON with newlines in strings, even though Minecraft can parse it without issue.

Open DorkOrc opened this issue 1 year ago • 1 comments

For example, Minecraft reads and parses this just fine (in 1.20.4):

{
	"pools": [
		{
			"rolls": 1,
			"entries": [
				{
					"type": "minecraft:item",
					"name": "minecraft:splash_potion",
					"functions": [
						{
							"function": "minecraft:set_nbt",
							"tag": "
								{
									Potion: \"minecraft:water\", 
									custom_potion_effects: [{id: \"minecraft:blindness\", duration: 400}], 
									CustomPotionColor: 2039587, 
									display: {
										Name: '{\"italic\":false,\"text\":\"Splash Potion of Blindness\"}'
									}, 
									RepairCost: 2147483647, 
									pandamium: {
										id: \"blindness_splash_potion\"
									}
								}
							"
						}
					]
				}
			]
		}
	]
}

But the generator doesn't seem to like it very much image

A weird edge-case, I know, but I found formatting the SNBT like that when writing the loot table helpful, and I noticed that I couldn't import it to make edits 😅

DorkOrc avatar Mar 08 '24 01:03 DorkOrc

This looks extremely cursed. I don't know if I want to support "malformatted" JSON like this. I already somewhat support comments in JSON, but this is next level 😅

misode avatar Mar 22 '24 23:03 misode