mojira.dev
MC-274763

you can't add a line break when modifying a book with /item modify

in the modifier you need to set 2 backslashes like \ \ n(without the spaces, it does a line break here without), or else it won't work, but when using it, then the game adds a backslash in the books data for every backslash, making \ \ n into \\\\n in the nbt

book made with the following command:

/give @p written_book[written_book_content={title:"",author:"",pages:['[{"text":"hello\\n"},"no"]']}] 1
[media]

book made with /item modify command:

/give @p written_book
/item modify entity @s weapon.mainhand {"function":"minecraft:set_written_book_pages","pages":[{"text":"hello\\n","extra":[{"text":"no"}]}],"mode":"append"}
[media]

Linked issues

Attachments

Comments 1

Thank you for your report!
We're tracking this issue in MC-119659, 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

KingIwrs

(Unassigned)

Unconfirmed

(Unassigned)

1.21

Retrieved