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

Linked issues

Attachments

Comments 9

Can confirm in 20w51a.

Can confirm in 21w03a.

Can confirm in 21w06a.

Can confirm in 21w07a.

Can confirm in 1.16.5 and 21w08b.

Can confirm in 21w10a. Video attached.

Can confirm in 1.18.1.

Can confirm in 1.19 and 1.19.1 Pre-release 1.

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.

Oskar Pester

(Unassigned)

Confirmed

Items

Minecraft 1.14, 1.14.4, 19w46b, 1.16.3, 1.16.4 Pre-release 1, ..., 21w08b, 21w10a, 1.18.1, 1.19, 1.19.1 Pre-release 1

Retrieved