Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-119659

Book and quill won't allow for new lines through command blocks

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: Minecraft 1.12, Minecraft 1.12.2, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 19w12b, Minecraft 19w13b, Minecraft 1.14
    • Fix Version/s: None
    • Confirmation Status:
      Confirmed
    • Category:
      (Unassigned)

      Description

      The bug

      Book & Quills can be created through commands or command blocks (through the /give commands or as the inventory of a chest in a /setblock command), however, not all book & quills that can be made in the game can be made through a command. A similar fix was previously done for signed, written books, and I'm looking for that fix to be applied to writable books / book & quills as well.

      Specifically, previous bug MC-52919 (same title), fixed the written_book item so that it accepts tellraw formatted text, allowing newline characters ('\n') in the text of commands to be interpreted a line breaks in the text of the written book (a place where the user pressed enter). (1.12 has change how the text parser for command interprets \n inside quoted text, so now
      n is needed, but otherwise the commands in the comments of MC-52919 work)
      Unfortunately, this fix only was applied to the written_book item. The writable_book item, while supporting the same text features in game (as it is turning into the written_book item once signed), does not support the tellraw format in a command, and therefore it isn't possible to use a command to create a writable book that happens to have line breaks / new line characters in it's text, even though it is possible to make such an object in game with the standard book & quill interface.

      Examples:
      This command works in game:

      /give @a written_book{title:"Test",author:"test",pages:["{text:\"Line 1\\nLine 2\"}"]}
      

      It produces a written book with the following text on the first page:

      Line 1
      Line 2
      

      This command does not work as expected:

      /give @a writable_book{pages:["{text:\"Line 1\\nLine 2\"}"]}
      

      This is expected to produce a book similar to the above, except not signed yet. Instead it produces a not signed book with the following text on page 1:

      {text:"Line 1\nLine 2"}
      

      As writable books and written books are similar objects in game (in fact writable books are turned into written books), I would expect that they would treat text similarly and both support newline characters in their text (as when creating the objects in game allows enter to be pressed to go to the start of the next line).

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              brian.risinger@gmail.com Brian Risinger
            • Votes:
              6 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                CHK: