-
Bug
-
Resolution: Won't Fix
-
None
-
1.20.4, 24w09a, 24w10a
-
None
-
Java 21, Windows 11
-
Community Consensus
-
Commands, Text
The newline character in JSON components is not properly handled by the client. Instead of displaying a line break, a line feed symbol is shown. This issue was resolved in MC-39987 for chat messages, but it persists for item names and lore. It's expected that the client interprets the newline \n character as a line break.
To reproduce this issue in 1.20.4, use the following command:
/give @s stone{display:{Name:"{\"text\":\"line 1\\nline 2\"}", Lore:["{\"text\":\"line 1\\nline 2\"}"]}}
for 24w09a+:
/give @s minecraft:stone[minecraft:custom_name="{\"text\":\"line 1\\nline 2\"}",minecraft:lore=["{\"text\":\"line 1\\nline 2\"}"]]
Bedrock edition handles newline characters correctly, displaying the text as intended on separate lines.
Fixing this issue would significantly benefit translations, especially since some languages require more space than others. Additionally, it would eliminate the need for multiple translation keys "line1", "line2", etc., just to achieve proper text wrapping.
- relates to
-
MC-39987 Newlines are not properly handled
- Resolved