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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 1.21
    • None
    • Unconfirmed
    • (Unassigned)

      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
      

      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"}
      

            Unassigned Unassigned
            IwrsTheKing007 IwrsTheKing007
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: