mojira.dev
MC-105303

Bed chat GUI not resetting sent messages history index after sending a message

The bug

When you lay in a bed, select a previously sent chat message, send this message and use the up or down arrow key again to select a previously sent chat message again, you will not see the last sent message first but instead the ones where you stopped moving in the history before.

How to reproduce

  1. (Not in a bed) Open the chat and type three different messages, for example

    1
    2
    3
  2. Start sleeping in a bed

  3. Use the UP arrow key to select the message "2" and send the message

  4. Use the UP arrow key again
    → The message that appears is "1" (the first message) instead of "3" if MC-4065 is not fixed or "2" (the last message) if MC-4065 is fixed

The reason

The following is based on a decompiled version of Minecraft 1.10 using MCP 9.30.

The reason for this is that the method net.minecraft.client.gui.GuiScreen.sendChatMessage(String) is not resetting the value of the sentHistoryCursor field, which stores the current index of the chat messages history the player last looked at. This method should set the value of the field to the size of the sent chat messages history list. For the normal chat GUI this bug is not visible because every time you open it, the GUI is recreated and the value of this field is "initialized" to the size of the message history list.

Linked issues

Comments 11

Maybe this and MC-4065 can be generalized to "Bed chat GUI not updating sent chat history"?

They are two different issues. MC-4065 only affects the bed chat GUI whereas this one affects the chat gui (and all its subclasses).

Can confirm for 1.11

Still present in 1.13.1

affects 1.16 candidate 1

1 more comments

Can confirm in 21w03a.

Can confirm in 21w05a.

Can confirm in 21w05b.

Can confirm in 21w06a.

Can confirm in 21w07a.

marcono1234

(Unassigned)

Confirmed

Text, UI

GUI, bed, chat, history

Minecraft 1.10.2, Minecraft 1.11, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 1.13.1, ..., 21w05a, 21w05b, 21w06a, 21w07a, 24w39a

Retrieved