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

Glowing is considered a positive effect in potion item tooltips

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Resolution: Unresolved
    • Minecraft 15w31c, Minecraft 15w32a, Minecraft 15w32b, Minecraft 15w32c, Minecraft 15w33b, Minecraft 15w33c, Minecraft 15w34a, Minecraft 15w34b, Minecraft 15w35b, Minecraft 15w39a, Minecraft 15w39b, Minecraft 15w44b, Minecraft 15w45a, Minecraft 15w46a, Minecraft 16w41a, Minecraft 16w42a, Minecraft 1.11.2, Minecraft 17w16b, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 17w43a, Minecraft 17w43b, Minecraft 18w15a, Minecraft 18w19b, Minecraft 18w20b, Minecraft 1.13-pre5, Minecraft 1.13-pre6, Minecraft 1.13.2, Minecraft 18w47a, Minecraft 18w47b, Minecraft 18w50a, 1.15.2, 20w18a, 1.16.2, 1.16.4, 20w49a, 20w51a, 21w03a, 21w05b, 21w06a, 21w07a, 21w11a, 21w17a, 1.17, 1.17.1 Pre-release 1, 1.17.1 Pre-release 2, 1.17.1 Pre-release 3, 1.17.1 Release Candidate 1, 1.17.1, 21w38a, 21w39a, 21w40a, 21w41a, 21w43a, 21w44a, 1.18 Pre-release 1, 1.18 Pre-release 7, 1.18 Release Candidate 1, 1.18 Release Candidate 3, 1.18, 1.18.1
    • None
    • None
    • Confirmed
    • UI

    Description

      The Bug:

      Glowing is considered a positive effect in potion item tooltips.

      In the HUD, glowing is displayed as a negative effect.

      Steps to Reproduce:

      • Give yourself a potion of glowing.
      • /give @s minecraft:potion{CustomPotionEffects:[{Id:24,Amplifier:1,Duration:200}]}
      • Hover over the item in your inventory.
      • Take note as to whether or not glowing is considered a positive effect in potion item tooltips.

      Observed Behavior:

      Glowing is considered a positive effect in potion item tooltips. The text in the potion tooltip is blue, indicating that glowing is considered a positive effect.

      Expected Behavior:

      Glowing would not be considered a positive effect in potion item tooltips. The text in the potion tooltip should be displayed as red to indicate that it's considered a negative effect.

      Code Analysis:

      The following is based on a decompiled version of Minecraft 1.17.1 using MCP-Reborn.

      net.minecraft.world.effect.MobEffectCategory.java
      public enum MobEffectCategory {
          BENEFICIAL(ChatFormatting.BLUE),
          HARMFUL(ChatFormatting.RED),
          NEUTRAL(ChatFormatting.BLUE);
      
          private final ChatFormatting tooltipFormatting;
      
          private MobEffectCategory(ChatFormatting p_19496_) { this.tooltipFormatting = p_19496_; }
      
          public ChatFormatting getTooltipFormatting() { return this.tooltipFormatting; }
      }

      If we look at the above class, we can see that neutral potion effects have chat formatting colors of blue, basically making them appear as this color in item tooltips.

      net.minecraft.world.effect.MobEffects.java
      public class MobEffects {
         ...
         public static final MobEffect GLOWING = register(24, "glowing", new MobEffect(MobEffectCategory.NEUTRAL, 9740385));
         ...

      If we locate the glowing effect within the MobEffects.java class, we can see that its MobEffectCategory is NEUTRAL. Potions labeled as neutral effects show as positive effects in item tooltips, but as negative effects in the HUD.

      Potential Fix:

      Simply changing the MobEffectCategory of the glowing effect to HARMFUL should resolve this problem. The correct line of code within its class should look something like the following:

      net.minecraft.world.effect.MobEffects.java
      public class MobEffects {
         ...
         public static final MobEffect GLOWING = register(24, "glowing", new MobEffect(MobEffectCategory.HARMFUL, 9740385));
         ...

      Attachments

        1. hud.png
          hud.png
          146 kB
        2. MC-84661.mp4
          4.35 MB
        3. MC-84661.png
          MC-84661.png
          590 kB
        4. MC-84661-1.png
          MC-84661-1.png
          60 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Avoma Avoma
              Votes:
              11 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                CHK: