The bug
Potion effect shadowing is imperfect. The precise problem is rather difficult to describe and I won't attempt to do so at the current time; suffice to say, this mainly manifests as particles appearing when they should not or being opaque when they should be ambient; due to the particle changes in 24w11a, this issue can be thought of as MC-96535 on a per-effect basis.
To reproduce
Build a level 1 beacon and set it to Speed, but put a solid block over it so you don't get the effect
Run
/effect give @s minecraft:speed infinite 0 true
Unblock the beacon
→ ❌ Notice how you have opaque Speed particles emanating form you.
Thoughts on a fix
Firstly, the show_particles
and ambient
booleans should be condensed into a single int, particle_opacity_level
; this isn't strictly necessarily but will make the rest of what I write here easier to understand. In this implementation, 2 means opaque, 1 means ambient and 0 means no particles at all.
Now, when an effect is applied to a mob which already has an active effect with the same id, the game should check if the amplifier
, particle_opacity_level
and show_icon
fields match. If they do, setting the duration
field to the longer of the two values is all that's necessary. However, if even one of these fields is different, a hidden effect instance must be created. The potion effect with the lower amplifier should be selected for storage in the hidden_effect
field; if the amplifiers are the same, the one with the shorter duration should become the hidden effect. (If a hidden effect already exists, the new one should be inserted at the appropriate level.)
When it comes time to put this NBT to use by creating particles and rendering the duration in the UI, the game should do the following for each effect ID:
Get the
amplifier
of the highest-level instance and use that as the level to show in the UI.Get the
duration
of the highest-level instance and use that as the duration to show in the UI.Get the highest
particle_opacity_level
in the entire hierarchy and use that to render the particles.Get the highest
show_icon
in the entire hierarchy and use that to render the icon.
Related issues
is duplicated by
Attachments
Comments


Can you reproduce this bug in 1.15.2?

Yes, same thing for 1.15.2. I just added that, thanks!
Hi there!
I can confirm for 20w28a.
Can confirm for 20w46a.
Can confirm in 20w51a.
Can confirm in 1.16.5.
Can confirm in 21w08b. Video attached.

Affects 21w37a.
So basically, the bug is that beacons and conduits seem to override the particle visibility settings of existing hidden effects when attempting to apply an effect of the same type, unless the hidden effect is of a lower amplifier than the new one, in which case it gets stored in the HiddenEffect tag as expected. This exception is also the case with MC-96535, but that bug is more of a rendering bug whereas here data is being modified improperly. (I was unable to reproduce this using ambient splash potions so the problem seems specific to beacons and conduits.)

Requesting ownership as the current owner has been inactive since 2021.