mojira.dev
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."

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 {color:#4c9aff}\n{color} 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.

Linked issues

Attachments

Comments 2

Thank you for your report!
We're tracking this issue in MC-279229, so this ticket is being resolved and linked as a duplicate.

If you would like to add a vote and any extra information to the main ticket it would be appreciated.

If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
-- I am a bot. This action was performed automatically! The ticket was resolved by one of our moderators, and I left this message to give more information to you.

StemonHD

(Unassigned)

Unconfirmed

(Unassigned)

25w02a

Retrieved