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

The `\n` escape sequence does not work in the `tellraw` command in Minecraft Snapshot 25w02a. Instead of creating a new line, it throws an error stating "Invalid escape sequence '\n' in string."

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 25w02a
    • None
    • Windows 11
      The latest Java version
    • Unconfirmed
    • (Unassigned)

      Bug Title:
      Invalid Escape Sequence \n in tellraw Command

      Description:
      In the Minecraft Snapshot version 25w02a, using the escape sequence \n in the tellraw command results in an error. Instead of interpreting the sequence correctly, the game throws a syntax error:

      Error Message:

       

      Invalid escape sequence '\n' in string at position 33

      Example:

       

      /tellraw @p ["Line 1",\{"text":"\n"},"Line 2"]

      Expected Behavior:
      The text should be correctly interpreted and displayed across two lines, like this:

       

      Line 1

      Line 2

      Actual Behavior:
      The command results in an error, and the escape sequence \n is not accepted. Instead, the error points to an invalid escape sequence in the JSON string.

      Additional Information:

      • Version: Minecraft Snapshot 25w02a
      • Mode: Tested in singleplayer.
      • Other Escape Sequences: It is unclear whether other escape sequences are also affected.

      Steps to Reproduce:

      1. Open a world in Minecraft Snapshot version 25w02a.
      2. Execute the following command:
        /tellraw @p ["Line 1",\{"text":"\n"},"Line 2"]
      3. Observe that the error message appears and the command fails to execute.

      Expected Result:
      The game should process the escape sequence \n and display the text on two separate lines.

      Actual Result:
      The error message indicates an invalid escape sequence, and the command does not execute.

      Note:
      This may indicate that the tellraw JSON implementation does not support or correctly process escape sequences like \n.

            Unassigned Unassigned
            StemonHD StemonHD
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: