Mojira Archive
MC-150279

Empty books can't be signed

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).

Awaiting Response

Oskar Pester

2019-04-29, 02:07 PM

2024-01-24, 01:53 AM

2024-01-24, 01:53 AM

7

2

Confirmed

Items

Minecraft 1.14 - 1.19.1 Pre-release 1Minecraft 1.14, 1.14.4, 19w46b, 1.16.3, 1.16.4 Pre-release 1, 20w51a, 21w03a, 1.16.5, 21w06a, 21w07a, 21w08b, 21w10a, 1.18.1, 1.19, 1.19.1 Pre-release 1

-