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

Empty books can't be signed

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Resolution: Unresolved
    • Minecraft 1.14, 1.14.4, 19w46b, 1.16.3, 1.16.4 Pre-release 1, 20w51a, 21w03a, 1.16.5, 21w06a, 21w07a, 21w08b, 21w10a
    • None
    • None
    • Confirmed
    • Items

    Description

      The bug

      Empty writable books cannot be signed. The GUI allows pressing the "Sign" and "Sign And Close" buttons, but nothing happens afterwards. The book is still writable and has not been signed.

      Expected would be either that:

      • It is possible to sign empty books
      • The "Sign" button is disabled when the book is empty

      Code analysis

      1.16.4-pre1 Mojang names

      There is a logic mismatch between client and server code. The client omits the pages NBT tag when all pages are empty in net.minecraft.client.gui.screens.inventory.BookEditScreen.saveChanges(boolean). However on the server side net.minecraft.world.item.WritableBookItem.makeSureTagIsValid(CompoundTag) considers a book invalid if it does not have a pages tag.

      Also note that with the recent addition of the text filter in 1.16.4-pre1, the server will throw an exception if pages is present, but empty.

      And as additional side note: BookEditScreen.saveChanges(boolean) should not send the author because the server ignores the client provided value and determines the author itself (as expected).

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Oskar_Petersilie Oskar Pester
              Votes:
              5 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                CHK: