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.
Linked issues
relates to 1
Attachments
Comments 8
Thank you for your report!
After consideration, the issue is being closed as Won't Fix.
Please note that this is not the same as Working as Intended, as this bug report correctly describes behavior in the game that might not be the intended or desirable behavior, but it will not be fixed right now. Sometimes, this is because the issue reported is minor and/or impossible to change without large architectural changes to the code base.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
I find it quite disappointing that this issue won't be addressed, especially considering its benefits and the parity mismatch. I would have thought now would be the best of times to fix it, given the current significant efforts being made to rework items. It's unfortunate that such valid concerns are not being resolved at this time. Additionally, the absence of a specified timeframe for when, or if, this might be reconsidered only adds to the frustration. Importantly, the fact that this issue has been reported multiple times indicates a persistent demand for a fix from the community, highlighting not just a recurring problem but a clear desire for resolution.
The incorrect handling of newline characters in item names and lores may seem minor to the development team and most players, however, it poses a significant barrier to those aiming to support accessibility and inclusivity through resource packs, whether that be for a mod, a map or a server. Although this issue primarily impacts creators, its ripple effect hinders the broader goal of ensuring the game is inclusive for the diverse community of players we want to include into our creations. As I mentioned in my issue, this complicates translations and forces creators into cumbersome workarounds, ultimately limiting the game's accessibility and inclusivity on a global scale.
Can confirm, here is an updated command for 24w09a