[MC-1685] Unable to write in a new blank Book and Quill after renaming it in an anvil Created: 01/Nov/12  Updated: 01/May/18  Resolved: 24/Nov/17

Status: Resolved
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 1.4.3, Minecraft 1.4.5, Minecraft 1.4.6, Minecraft 1.4.7, Snapshot 13w02a, Snapshot 13w02b, Minecraft 1.5, Snapshot 13w11a, Minecraft 1.5.1, Snapshot 13w16a, Minecraft 1.5.2, Snapshot 13w18b, Snapshot 13w18c, Minecraft 1.6.1, Minecraft 1.6.2, Minecraft 1.6.4, Minecraft 1.7.1, Minecraft 1.7.2, Minecraft 13w47c, Minecraft 1.7.4, Minecraft 14w02c, Minecraft 14w03a, Minecraft 14w03b, Minecraft 14w04b, Minecraft 14w05b, Minecraft 14w06a, Minecraft 14w06b, Minecraft 14w07a, Minecraft 14w08a, Minecraft 14w18b, Minecraft 14w20b, Minecraft 14w21b, Minecraft 1.7.10, Minecraft 14w30b, Minecraft 14w30c, Minecraft 14w31a, Minecraft 14w33c, Minecraft 14w34a, Minecraft 14w34b, Minecraft 14w34c, Minecraft 14w34d, Minecraft 1.8-pre1, Minecraft 1.8, Minecraft 1.8.1-pre3, Minecraft 1.8.1, Minecraft 1.8.8, Minecraft 15w36b, Minecraft 15w36c, Minecraft 15w36d, Minecraft 15w51b, Minecraft 16w03a, Minecraft 16w05b, Minecraft 16w06a, Minecraft 16w07a, Minecraft 16w07b, Minecraft 1.9 Pre-Release 2, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 1, Minecraft 1.9.1 Pre-Release 2, Minecraft 1.9.1 Pre-Release 3, Minecraft 1.9.1, Minecraft 1.9.2, Minecraft 16w14a, Minecraft 1.9.3 Pre-Release 3, Minecraft 1.9.4, Minecraft 16w20a, Minecraft 16w21a, Minecraft 16w21b, Minecraft 1.10 Pre-Release 1, Minecraft 1.10 Pre-Release 2, Minecraft 1.10, Minecraft 1.10.1, Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w32b, Minecraft 16w33a, Minecraft 16w35a, Minecraft 16w40a, Minecraft 1.11, Minecraft 1.11.2, Minecraft 17w17b, Minecraft 1.12, Minecraft 1.12.1 Pre-Release 1, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 17w43a, Minecraft 17w43b
Fix Version/s: Minecraft 17w48a

Type: Bug
Reporter: tomekch6 Assignee: [Mojang] Maria Lemón
Resolution: Fixed Votes: 57
Labels: display-Name, item-renaming, writable_book

Issue Links:
Duplicate
is duplicated by MC-6864 Book and Quill requires update when r... Resolved
is duplicated by MC-7114 11 January 2013 Resolved
is duplicated by MC-12441 Unable to write in Book and Quill aft... Resolved
is duplicated by MC-25551 Cannot type in renamed books Resolved
is duplicated by MC-26543 Can't write on Rename book Resolved
is duplicated by MC-26635 Cant write in book and quils. Resolved
is duplicated by MC-35490 Cannot type in Book and Quill that ha... Resolved
is duplicated by MC-44781 Bug with renamed Book and Quils Resolved
is duplicated by MC-45113 can not write on renamed book and qui... Resolved
is duplicated by MC-47294 Using /give to get a custom named boo... Resolved
is duplicated by MC-48159 Unable to Write in ReNamed Book and Quil Resolved
is duplicated by MC-48993 Named book and quill makes you not ab... Resolved
is duplicated by MC-49520 After using /give command can't write... Resolved
is duplicated by MC-54775 Renamed writable books can not be wri... Resolved
is duplicated by MC-55184 Named Book and Quill can not be edited Resolved
is duplicated by MC-55254 Renamed Book And Quills cant be typed in Resolved
is duplicated by MC-55557 Named Books Can't Be Edited Resolved
is duplicated by MC-56581 Cannot write in book when renamed wit... Resolved
is duplicated by MC-62030 Not Being able to write in book and q... Resolved
is duplicated by MC-74060 Can't wright in renamed book Resolved
is duplicated by MC-75504 You can't write in a book and quill w... Resolved
is duplicated by MC-87670 Cant Write in book Resolved
is duplicated by MC-87671 Cant write in rename book Resolved
is duplicated by MC-95157 I can't write on book and quill once ... Resolved
is duplicated by MC-96292 Unable to edit book and quill after r... Resolved
is duplicated by MC-102008 Can't type in unsigned Book and Quill... Resolved
is duplicated by MC-104669 Unable to type in a named book and qu... Resolved
is duplicated by MC-111742 Renamed Book and Quill won't take text Resolved
is duplicated by MC-113996 Book and Quill cannot be edited after... Resolved
is duplicated by MC-119616 New Book and Quill unable to be edite... Resolved
is duplicated by MC-119870 Renaming a Book and Quill makes it no... Resolved
is duplicated by MC-1958 i cant write a book when i named it w... Resolved
is duplicated by MC-2048 You cannon type in a renamed Book and... Resolved
Relates
relates to MC-84005 Book and quill doesn't save changes w... Resolved
CHK:
Confirmation Status: Confirmed

 Description   

The bug

When I use an anvil (repair & name) on "Book and Quill" after naming I can't write something in this book. I can sign it but it stay are not writed.

How to reproduce

  1. Get a new blank book and quill.
  2. Rename it.
  3. Try to type in it, it won't work.

Code analysis

Based on 1.11 decompiled using MCP 9.35 rc1

The constructor net.minecraft.client.gui.GuiScreenBook.GuiScreenBook(EntityPlayer, ItemStack, boolean) tests if the book has the tag tag and if this is the case tries to use its pages value. Because this tag does not exist an empty list is returned. The problem is that the test for bookTotalPages < 1 (= empty list) only sets the bookTotalPages attribute value to 1, but does not add an empty string to the pages. Because of this the player is unable to write something.

Suggested fix (1.11)
public GuiScreenBook(EntityPlayer player, ItemStack book, boolean isUnsigned)
{
    this.editingPlayer = player;
    this.bookObj = book;
    this.bookIsUnsigned = isUnsigned;

    if (book.hasTagCompound())
    {
        NBTTagCompound nbttagcompound = book.getTagCompound();
        this.bookPages = nbttagcompound.getTagList("pages", 8).copy();
        this.bookTotalPages = this.bookPages.tagCount();

        if (this.bookTotalPages < 1)
        {
            // Added the following line
            this.bookPages.appendTag(new NBTTagString(""));
            this.bookTotalPages = 1;
        }
    }

    if (this.bookPages == null && isUnsigned)
    {
        this.bookPages = new NBTTagList();
        this.bookPages.appendTag(new NBTTagString(""));
        this.bookTotalPages = 1;
    }
}


 Comments   
Comment by Daedalus Young [ 02/Nov/12 ]

Could somebody please edit the title of this issue?

[edit] Thank you very much, it's easier to find now

Comment by TS [ 21/Nov/12 ]

This still applies in 1.4.5.

Also, it does not apply to books that have already been written in. Only new, un-edited books.

Comment by [Mod] CubeTheThird [ 25/Nov/12 ]

Can confirm.

Comment by Maarten Thijs [ 29/Dec/12 ]

can confirm. sucks

Comment by Alexander Spielvogel [ 16/Mar/13 ]

As a small sidenote: It would be great if you could use the cursorkeys to move the input cursor, when you need to edit something on top you have to delete all text and type it again.

Comment by [Mod] CubeTheThird [ 16/Mar/13 ]

@Alexander: see MC-1578 for information on that issue.

Comment by Chad Garion [ 22/Apr/13 ]

Confirmed in Snapshot 13w16a. I've never had this problem before now and never knew it's been going on for so long.

Comment by Will [ 19/May/13 ]

Confirmed for 1.5.2 in multiplayer. Please fix!

Comment by Alex Ivanov [ 21/Jul/13 ]

Confirmed for 1.6.2 SP/MP, the issue is not resolved.

Comment by Tails [ 21/Jul/13 ]

Reopened with a better description. Missing detail was the book needed to be unused.

Comment by Tomáš Gdula [ 22/Nov/13 ]

Bug still appears in snapshot 13w47c.

Comment by Manuel Gwosdz [ 14/Jan/14 ]

Still happens in 14w02c, but also works with ANY Nbt-tag when pages:[] does not exist/is empty.

Comment by Armin Abe [ 17/Jan/14 ]

Still in 14w03b.

Comment by Dookie Burnout [ 30/Jan/14 ]

Still happens in 14w05a. If the book and quill has been renamed or if it's enchanted with the /give command, it can't be edited.

Comment by iamdarkyoshi [ 09/Feb/14 ]

Confirmed in 14w06b. I am making a teleporter on my map using a writable book and /clear, but i cannot give the player a renamed book. this is annoying.

Comment by Ziggy Ziegelmueller [ 20/Feb/14 ]

This also applies to ANY tag added to the book with the /give command. I tested this in 14w08a, but it also applies to earlier snapshots.

Comment by iamdarkyoshi [ 20/Feb/14 ]

I found a temporary fix: when using /give, add a page with nothing in it, and the book is writable.

Comment by Damian Johnes [ 18/May/14 ]

Still applies to snapshot 14w20b.

Comment by [Mod] Skylinerw [ 29/Jul/14 ]

Confirmed for 14w30c.

Comment by Liam Whitt [ 31/Jul/14 ]

Confirmed for 14w31a.

Comment by Alex Ivanov [ 02/Sep/14 ]

Confirmed for 1.8.

Comment by Whatever account [ 30/Mar/15 ]

Just to add to this, the only way around this bug is to create a page 2 by clicking on the arrow, then going back to page 1 and start typing.

Comment by qmagnet [ 10/Sep/15 ]

Confirmed for 15w36d

Comment by QwertyuiopThePie [ 17/Feb/16 ]

Confirmed for 16w07b.

Comment by Colton Jelsema [ 21/Feb/16 ]

Confirmed for 1.9-pre2

Comment by [Mod] null [ 23/Mar/16 ]

Confirmed for 1.9.1-pre3.

Comment by [Mod] null [ 05/May/16 ]

Confirmed for 1.9.3-pre3.

Comment by [Mod] null [ 11/May/16 ]

Confirmed for 1.9.4.

Comment by Vitold Chernatinski [ 16/May/16 ]

The problem lies in the NBT tags. There is no NBT tag when the book is virgin but once any writing is placed, even if immediately erased before ever closing, an NBT tag is created and writing is allowed.

Comment by [Mod] null [ 18/May/16 ]

Confirmed for 16w20a.

Comment by [Mod] null [ 25/May/16 ]

Confirmed for 16w21a.

Comment by [Mod] null [ 26/May/16 ]

Confirmed for 16w21b.

Comment by [Mod] null [ 02/Jun/16 ]

Confirmed for 1.10-pre1.

Comment by [Mod] null [ 07/Jun/16 ]

Confirmed for 1.10-pre2.

Comment by [Mod] null [ 08/Jun/16 ]

Confirmed for 1.10.

Comment by [Mod] null [ 22/Jun/16 ]

Confirmed for 1.10.1.

Comment by [Mod] null [ 23/Jun/16 ]

Confirmed for 1.10.2.

Comment by Robin Gravel [ 06/Oct/16 ]

Happened to 16w40a.

Comment by Thadius Faran [ 07/Jan/17 ]

This is apparently a VERY old bug that i'd very much like remedied.

Comment by Samuel Ohlsson [ 19/Jan/17 ]

Confirmed for 1.11.2

Comment by QwertyuiopThePie [ 28/Apr/17 ]

Confirmed for 17w17b

Comment by Nikos Moe [ 29/Aug/17 ]

Confirmed for 1.12.1

Comment by Earthcomputer [ 05/Nov/17 ]

Just happened to me on 1.12.2

Comment by Earthcomputer [ 05/Nov/17 ]

Affects 17w43b

Generated at Sun Sep 23 12:44:47 CDT 2018 using Jira 7.11.2#711002-sha1:fdc329dee91471a641faabfe39b5ff8c0a5b3f66.