Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DorkOrc opened this issue Mar 8, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@DorkOrc
Copy link

DorkOrc commented Mar 8, 2024

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 😅

@misode
Copy link
Owner

misode commented Mar 22, 2024

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 misode added the enhancement New feature or request label Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants