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

JSON CustomName will parse, but does not resolve score

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • Minecraft 1.13-pre5
    • None
    • Win10 creative update, java 1.8.0
    • Unconfirmed

      Setting the custom name of a sign to a score via JSON translators works but does not for entity (armor stand)

      to recreate:

      #create a dummy scoreboard objective called TEMP
      [COMMAND LINE/IMPULSE]
      /scoreboard objectives add TEMP dummy TEMP

      #set it to sidebar so you can see it
      [COMMAND LINE/IMPULSE]
      /scoreboard objectives setdisplay sidebar TEMP

      #create an arbitrary scoreboard name to pull from (put this on a repeat block)
      [REPEAT/UNCONDITIONAL/ALWAYS ACTIVE]
      /scoreboard players add SOURCEVAL TEMP 1

      #Demonstrate that you can use JSON to generate a fancy custom name
      [COMMAND LINE/IMPULSE]
      /summon armor_stand ~ ~ ~ {CustomNameVisible:1b,CustomName:"

      {\"text\":\"asdf\",\"color\":\"aqua\",\"bold\":true,\"italic\":true,\"underlined\":true,\"strikethrough\":true,\"obfuscated\":true}

      "}

      #Demonstrate that you can use JSON to keep track of a score on a sign which is on top of this command block
      [REPEAT/UNCONDITIONAL/ALWAYS ACTIVE]
      data merge block ~ ~1 ~ {x: 8, Text4: "

      {\"text\":\"line 4\"}

      ", y: 51, Text3: "

      {\"text\":\"line 3\"}

      ", z: 13, Text2: "

      {\"text\":\"line 2\"}

      ", id: "minecraft:sign", Text1: "{\"score\":{\"name\":\"SOURCEVAL\",\"objective\":\"TEMP\"}}"}

      **
      NOTE: everything up to this point behaves as it should. the armor stand spawns with wonky text for a name, and the sign will display the score of the arbitrary objective score
      **

      #attempt to use the JSON from the working sign to name an armor stand the numeric value for some objective score
      [COMMAND LINE/IMPULSE]
      /summon armor_stand ~ ~ ~ {CustomNameVisible:1b,CustomName:"{\"score\":{\"name\":\"SOURCEVAL\",\"objective\":\"TEMP\"}}"}

      **
      The result from this command is an armor stand displaying its name as an empty string.
      **

      #check the contents of the armor stand's custom name value
      [COMMAND LINE/IMPULSE]
      /data get entity @e[type=armor_stand,distance=0..5,limit=1]

      **RESULT:
      [23:23:22] has the following entity data: "{\"score\":{\"name\":\"SOURCEVAL\",\"objective\":\"TEMP\",\"value\":\"\"}}"
      **

      **NOTE::
      I never specified value because that should be being done on the back end, however, the new CustomName data is being at least parsed and filled in here since it's got new information that i never entered, indicating that the back end has at least noticed the score.
      **

            Unassigned Unassigned
            never2fear Charlie Miller
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: