Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-201723

Statistics sprites don't look pressed when clicked

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 1.16.3, 1.16.4, 20w46a, 20w48a, 20w49a, 20w51a, 21w03a, 1.16.5, 21w05a, 21w05b, 21w06a, 21w07a, 21w08b, 21w10a, 21w11a, 21w13a, 21w14a, 21w15a, 21w16a, 21w18a, 21w19a, 21w20a, 1.17, 1.17.1, 21w41a
    • Fix Version/s: None
    • Labels:
      None
    • Confirmation Status:
      Confirmed
    • Category:
      (Unassigned)

      Description

      This happens since 1.13.

      When going to Pause Menu->Statistics->Items, when I click at one of the sprites it does not change its look to its "pressed" state.

       

      Code analysis:

      This bug is caused by net.minecraft.client.MouseHandler.isLeftPressed() returning always false (even if the left mouse button is pressed) while on the statistics screen. This method is called just before rendering the sprites, and because of said method returning false it sets net.minecraft.client.gui.screens.achievement.StatsScreen.ItemStatisticsList.headerPressed to -1.

       

      How to fix (it worked on my modified client):

      Just copy the code from below to net.minecraft.client.gui.screens.achievement.StatsScreen.ItemStatisticsList and remove the conditional "if (!this.minecraft.mouseHandler.isLeftPressed())" and its content from net.minecraft.client.gui.screens.achievement.StatsScreen.ItemStatisticsList.renderHeader().

       

      public boolean mouseReleased(double mouseX, double mouseY, int clickedMouseButton)
       {
        if (clickedMouseButton == 0 && this.itemStatsList != null)
        {
         this.itemStatsList.headerPressed = -1;
        }
        return super.mouseReleased(mouseX, mouseY, clickedMouseButton);
       }
      

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            ISRosillo14 Ismael Rosillo
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              CHK: