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 by using the command provided below.
/give @s minecraft:potion[minecraft:potion_contents={custom_effects:[{id:"minecraft:glowing",duration:1200}]}]
Hold your mouse cursor over the item in your inventory.
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 in red to indicate that it's considered a negative effect.
Code Analysis:
Code analysis by @unknown can be found below.
The following is based on a decompiled version of Minecraft 1.19.2 using MCP-Reborn.
net.minecraft.world.effect.MobEffectCategory.java
public enum MobEffectCategory {
BENEFICIAL(ChatFormatting.BLUE),
HARMFUL(ChatFormatting.RED),
NEUTRAL(ChatFormatting.BLUE);
...
net.minecraft.world.effect.MobEffects.java
public class MobEffects {
...
public static final MobEffect GLOWING = register(24, "glowing", new MobEffect(MobEffectCategory.NEUTRAL, 9740385));
...
If we look at the above classes, we can see that mob effects that are included within the NEUTRAL
category are formatted in blue. Since the glowing effect is categorized as a NEUTRAL
effect, it appears blue in potion item tooltips, therefore resulting in this issue occurring.
Fix:
Simply changing the categorization of the glowing effect to HARMFUL
will format this effect in red within potion item tooltips, thus resolving this problem.
Linked issues
relates to 4
Attachments
Comments 19

Still an issue for 15w32c.

Still an issue in 18w15a. and other 1.13 snapshots.

Related to MC-127924

Affects 1.13-pre5.
Can confirm in 21w17a.
Can confirm in 1.17. I'd like to request ownership of this ticket since the current reporter has been inactive since June 2018. I'm willing to provide all of the necessary information and will keep this report updated.
Following on from my code analysis, I've double-checked my proposed fix and I can confidently confirm that it's fully functioning and works as expected, so I've attached two screenshots to this report, one of which shows the current code and the other that shows the fixed code. I feel this information may be quite insightful hence my reasoning for providing it. 🙂
[media][media]The command in the description no longer works, here is an updated one
/give @p potion{custom_potion_effects:[{id:"minecraft:glowing",amplifier:1b,duration:-1,show_particles:1b}]} 1
This is less so an issue specific to the glowing effect, but rather how neutral effects are treated in general. Currently, glowing is the only 'true' neutral effect in the game (with exception to MC-170462) so that's why the behavior is noticable with it specifically.
Right now, the game does not really differentiate neutral effects in any meaningful way, leading to the inconsistent behavior with them having blue tooltips like positive effects, while also being grouped together with negative effects in the in game hud. Looking in the code, the game doesn't specifically add neutral effects to be rendered with negative ones, but rather it seems like a byproduct of only trying to sort out positive ones.
Here's a snippit renderStatusEffectOverlay() in InGameHud, which determines the the location to render the effects in the in-game hud (the 'i', 'k', and 'j' are all just placeholder values for locations on the screen):
. . .
if (statusEffect.isBeneficial()) {
++i;
k -= 25 * i;
} else {
++j;
k -= 25 * j;
l += 26;
}
. . .
CONFIRMED - 15w32a, 15w32b