mojira.dev
MC-170462

Bad Omen is considered a positive effect in potion item tooltips

The bug

The bad omen effect is considered as a positive effect in the tooltips of a custom potion. I would have expect the tooltips for a custom bad omen potion to have the text to be color red as the effect icon of the actual effect appears in the lower row with the other negative effects.

How to reproduce

  1. Run the given command:

    /give @s minecraft:potion[minecraft:potion_contents={custom_effects:[{id:"minecraft:bad_omen",duration:1200}]}]
  2. Check the potion tooltips
    → ❌ The tooltips shows blue text instead of red

Code analysis

In the code, the "Bad Omen" potion effect is considered to be neutral (MobEffectCategory.NEUTRAL), not negative (MobEffectCategory.HARMFUL). Neutral effects show as positive effects in tooltips, but as negative effects in the HUD.

Linked issues

Attachments

Comments 17

Avoma

Can confirm in 20w51a.

Avoma

Can confirm in 21w03a.

user-f2760

This also affects glowing.

Bad Omen and Glowing are set as "Neutral" effects, according to the source code. Neutral means it gets blue text (like positive) but is listed with the negatives in the hud.

This makes absolutely no sense at all. Both effects should be declared negative, or neutral should have a separate color in potions and a separate list in the hud.

Avoma

Can confirm in 21w07a.

Avoma

Can confirm in 21w14a.

7 more comments
Avoma

Can confirm in 1.19.

Avoma

Can confirm in 1.19.2.

Avoma

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]
anthony cicinelli

This can now be seen without commands with the Ominous Bottle

Memor22

Since bad omen is now an optional potion that you drink yourself to get good loot, it should be counted as a positive effect

DrownedZombie

(Unassigned)

Confirmed

Platform

Low

UI

bad_omen

1.15.2, 20w06a, 20w11a, 20w13b, 20w17a, ..., 23w51b, 24w13a, 1.21, 1.21.4, 25w08a

Retrieved