Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-93094

Strict JSON does not work for most NBT data.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • None
    • Minecraft 15w47c
    • None
    • Windows 10.0 (64 bit)
      Java 1.8.0_25 (64 bit)
    • Unconfirmed

      This issue is related to MC-83460
      In the issue above it is clearly said that with 1.9 lenient JSON will be gone. Honestly, I hate this change a lot (welcome to backslash hell), but however so far only JSON texts (like in /tellraw or /title or a bok or a sign) can be written in strict JSON.
      If JSON has to be written in a strict JSON format in future versions, I want to do this as soon as possible.
      If I try the following command, it will not work, although it is strict JSON.

      /give @a minecraft:sign 1 0 {"display":{"Name":"JSON"}}

      However, it does work like this:

      /give @a minecraft:sign 1 0 {display:{Name:"JSON"}}}

      or even without any quotes:

      /give @a minecraft:sign 1 0 {display:{Name:JSON}}

      When I however want to do a /tellraw I need to do strict JSON (as inttended).

      /tellraw @a {"text":"I like blue","color":"blue"}

      If I want to add this text in JSON format into my book, I need to mix different JSON parsing.

      /give @a minecraft:sign 1 0 
      {
      	display:
      	{
      		Name:"JSON"
      	},
      	BlockEntityTag:
      	{
      		Text1:
      		"{
      			\"text\":\"I like blue\",
      			\"color\":\"blue\"
      		}"
      	}
      }

      It becomes even more weird when I now add a clickEvent which gives me a book called JSON that has some JSON-text in it. See:

      /give @a minecraft:sign 1 0 
      {
      	display:
      	{
      		Name:JSON
      	},
      	BlockEntityTag:
      	{
      		Text1:
      		"{
      			\"text\":\"Wanna have a\",
      			\"color\":\"blue\",
      			\"clickEvent\":
      			{
      				\"action\":\"run_command\",
      				\"value\":
      				\"
      					/give @p minecraft:written_book 1 0 
      					{
      						title:JSON,
      						author:me,
      						pages:
      						[
      							\\\"
      								{
      									\\\\\\\"text\\\\\\\":\\\\\\\"Welcome to the backslash-hell (\\\\\\\\\\\\)\\\\\\\",
      									\\\\\\\"color\\\\\\\":\\\\\\\"dark_red\\\\\\\"
      								}
      							\\\"
      						]
      					}
      				\"
      			}
      		}",
      		Text2:
      		"{
      			\"text\":\"book?\",
      			\"color\":\"blue\"
      		}"
      	}
      }

      In the middle of it I have to use for the book's NBT again lenient JSON. An I am not able to use quotes there. This is inconsistent.
      I would prefer it much if you could lenient JSON again (seriously look at the amount of backslashes!). But Mojang must have big reasons top change it. But it's a bug that you can't use strict JSON everywhere.
      I hope minecraft will move to slash heaven soon again. But let's make it consistent at first. Otherwise the change simply makes no sense at all.

            Unassigned Unassigned
            Schortan [Mod] NeunEinser
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: