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).
Linked issues
Attachments
Comments 9
Cannot reproduce in the last affected version, 1.19.1 Pre-release 1. The book requires that you add a title before signing it, and when you do add a title and sign it, the book properly signs:
[media]
Are you still able to reproduce this issue in the latest version, 24w03b? If so, please add proper steps to reproduce, and a video showcasing it.
Can confirm in 20w51a.