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

Chat, /tellraw, and other commands trim excess whitespace

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reopened
    • Resolution: Unresolved
    • Affects Version/s: Minecraft 14w31a, Minecraft 1.8.3, Minecraft 1.8.4, Minecraft 16w04a, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 3, Minecraft 16w15b, Minecraft 1.12, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 17w47b, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 18w50a, Minecraft 1.14 Pre-Release 2
    • Fix Version/s: Minecraft 16w04a
    • Labels:
    • Confirmation Status:
      Confirmed
    • Category:
      Commands

      Description

      The bug

      If you place a sign, and type in " 1" (note the leading spaces), it will display as written, with the number off-center.
      If you type

      /setblock ~ ~1 ~1 wall_sign 3 replace {Text1:"  1"}

      The leading spaces will be trimmed off and the text will be centered on the sign. The same thing will happen if you put the command in a command block and run it that way.

      However, if the excess spaces are between two words, they will be preserved if entered using a command block, but will be stripped out if entered in chat, whether as normal speech, or as part of a command.

      Code analysis

      Code analysis by [Mod] Marcono1234 can be found in this comment.

        Attachments

        1. command.png
          command.png
          268 kB
        2. sign.png
          sign.png
          194 kB

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                SuperMegaDuck Luke Nguyen
              • Votes:
                13 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated:
                  CHK: