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

JSON selector tag incorrect behaviour

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Awaiting Response
    • Affects Version/s: Minecraft 1.8.8
    • Fix Version/s: None
    • Confirmation Status:
      Unconfirmed

      Description

      Extra empty string

      Every time a selector tag is successfully parsed Minecraft creates one "text":"" behind it.

      Book example
      /give @p written_book 1 0 {author:a,title:b,pages:["{\"selector\":\"@p\"}"]}
      
      Book example NBT structure
      pages:[
      	"{
      		\"extra\":[
      			{
      				\"insertion\":\"Marcono1234\",
      				\"clickEvent\":{
      					\"action\":\"suggest_command\",
      					\"value\":\"/msg Marcono1234 \"
      				},
      				\"hoverEvent\":{
      					\"action\":\"show_entity\",
      					\"value\":\"{
      						name:\\"Marcono1234\\",
      						id:\\"0fec4f7a-6a9b-4c43-ad1b-235e7fbc9822\\"
      					}\"
      				},
      				\"text\":\"Marcono1234\"
      			}
      		],
      		\"text\":\"\"
      	}"
      ]
      

      Invalid selector

      When a player/entity cannot be found, Minecraft creates an empty string instead which it inserts at the place where the selector element was.

      Book example
      /give @p written_book 1 0 {author:a,title:b,pages:["["",{\"selector\":\"@p[name=Notch]\"},{\"text\":\"A\"}]"]}
      
      Book example NBT structure
      pages:[
      	"{
      		\"extra\":[
      			\"\",
      			\"A\"
      		],
      		\"text\":\"\"
      	}"
      ]
      

      Note: Ignore the \"text\":\"\", it is caused by the way Minecraft parses JSON-text that is present as a list.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                marcono1234 [Mod] Marcono1234
              • Votes:
                3 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: