The bug
Hiding the particles of a potion effect also hides the icon at the top right.
How to reproduce
Try these two commands and watch what happens with the icon:
/effect give @s minecraft:night_vision 999 1 false
/effect give @s minecraft:night_vision 999 1 true
Example
Here is an example in video:
[media]Linked issues
is duplicated by 2
Attachments
Comments 11
It's still a thing, even in the experimental combat update snapshot.
But I personally don't believe it's an issue. Take adventure maps as an example. You don't want to distract the player with the potion effects, do you? The same applies to the effect display: it doesn't break the immersion that much, it only makes sense.
This isn't a bug! You don't want to display that icon for example in maps when you want to hide that you have an effect.
@DelimanCZ It is very likely that it is not a bug, but we have to wait for Mojang's official answer.
There is a partial fix for this bug/feature request in 1.21. Item components specifying potion contents contain both a "show_particles" and "show_icon" field. Setting the former to false will default to hiding the icon as well, but it can be overridden with show_icon:true. Other places where effects can be defined (such as the /effect command) do not have this feature yet, so it's still not completely "resolved" if we consider this a bug.
Code analysis from MC-276746 by @unknown:
From the ThrownPotion.applySplash() method:
for (MobEffectInstance mobEffectInstance : effects) {
Holder<MobEffect> holder = mobEffectInstance.getEffect();
if (holder.value().isInstantenous()) {
holder.value().applyInstantenousEffect(this, this.getOwner(), livingEntity, mobEffectInstance.getAmplifier(), e);
} else {
int i = mobEffectInstance.mapDuration(duration -> (int) (e * (double)duration + 0.5));
MobEffectInstance mobEffectInstance2 = new MobEffectInstance(
holder, i, mobEffectInstance.getAmplifier(), mobEffectInstance.isAmbient(), mobEffectInstance.isVisible()
);
if (!mobEffectInstance2.endsWithin(20)) {
livingEntity.addEffect(mobEffectInstance2, entity2);
}
}
}
mobEffectInstance2 should actually be:
MobEffectInstance mobEffectInstance2 = new MobEffectInstance(
holder, i, mobEffectInstance.getAmplifier(), mobEffectInstance.isAmbient(), mobEffectInstance.isVisible(), mobEffectInstance.showIcon()
);
This is also true for Lingering potions. In AreaEffectCloud.tick(), you can find where it applies status effects to entities and see it's missing the showIcon() parameter when a new mob effect instance is created from the PotionContents data. While this doesn't affect normal gameplay, it is something that caused me a bit of a headache trying to figure out, so I thought I should at least report it since it would be a fairly simple fix.
Still in 1.14.1 Release
Can someone else confirm too?