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

NBT data as command output has incomplete String escaping

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: Minecraft 15w42a, Minecraft 15w45a, Minecraft 16w42a, Minecraft 1.11, Minecraft 1.11.2, Minecraft 17w15a, Minecraft 17w16a, Minecraft 17w16b, Minecraft 17w17a
    • Fix Version/s: Minecraft 1.12
    • Confirmation Status:
      Confirmed

      Description

      Introduction

      When a command modifies or for some commands also not modifies the NBT data of an entity or a block, the chat shows the current NBT data.

      The bug

      I noticed a bug after recompiling Minecraft 1.8 using MCP which is still present in the latest version. When the toString() method of a NBTTagString is called, it only replaces double quotes (") with escaped double quotes (\").
      This can cause problems as the output is supposed to represent the correct NBT data of an object. As it is missing the backslash escaping it would cause two backslashes to become one.

      For 1.9 see [Mod] null's comment

      How to reproduce

      1. Use the following command:
        /summon armor_stand ~ ~ ~ {CustomName:"\"\\a"}
        
      2. Use the following command:
        /entitydata @e[type=armor_stand,c=1] {CustomNameVisible:1b}
        

      The output probably shows something like this:

      ...CustomName:"\"\a"...
      

      But as you see that was not what you entered.

        Attachments

          Activity

            People

            • Assignee:
              grum [Mojang] Grum (Erik Broes)
              Reporter:
              marcono1234 [Helper] Marcono1234
            • Votes:
              4 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                CHK: