mojira.dev
MC-156163

F3 + I does not preserve new lines in unwritten books in lecterns

The bug

Using the F3 + I key bind on a lectern with a book and quill does not preserve new line characters.  For example, typing:

hello
world

into a book and quill, placing it on a lectern, and using F3 + I obtains:

/setblock ~ ~ ~ minecraft:lectern[facing=south,has_book=true,powered=false]{Book:{id:"minecraft:writable_book",Count:1b,tag:{pages:["hello
world"]}},Page:0}

When used to generate a new lectern, this command produces a book and quill with the text:

helloworld

Attempting to manually insert the new-line character, \n, between "hello" and "world" results in the error: "Invalid Escape sequence '\n' in quoted string."

This issue does not occur with written books, and is likely related to a discrepancy between written and unwritten books: unlike written books, unwritten books do not appear to accept JSON-formated text.

For example:

/give @p minecraft:written_book{pages:['{"text":"hello\\nworld"}'],author:"None",title:"Test"}

results in:

hello
world

However,

/give @p minecraft:writable_book{pages:['{"text":"hello\\nworld"}']}

results in the literal text:

{"text":"hello\nworld"}

This portion of the issue also occurs when /setblock is used to summon lecterns.

How to reproduce

  1. Enter the following text into book and quill:

    Test
    Test
  2. Without signing the book, place it onto a lectern

  3. Right-click the lectern to read the book
    → ✔ The text is displayed correctly

  4. Exit the lectern GUI and press F3 + I while looking at the lectern

  5. Destroy the lectern

  6. Run the command that was copied to your clipboard

  7. Right-click the lectern again
    → ❌ The text in the book now reads: "TestTest"

Linked issues

Comments 2

Confirmed in 1.16.1 and 20w27a.

Thank you for your report!
However, this issue is a Duplicate of MC-119659.

It has been linked to this report. If you have additional information, please add it to that report.
Please search before reporting, as it's likely that one exists already.

Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – 📖 Game Wiki

Billiam

(Unassigned)

Confirmed

(Unassigned)

Minecraft 1.14.3, 1.16.1, 20w27a, 1.16.2

Retrieved