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

Applying an effect with particles hidden will be unhidden by beacons, conduits and dolphins for the same effect

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.15.2, 1.16 Pre-release 5, 1.16.1, 20w27a, 20w28a, 20w29a, 20w30a, 1.16.2 Pre-release 1, 1.16.2, 20w46a, 20w51a, 1.16.5, 21w08b, 21w37a, 1.19.2, 23w13a, 24w11a, 24w13a
    • None
    • Confirmed
    • Beacon, Particles

      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

      1. Build a level 1 beacon and set it to Speed, but put a solid block over it so you don't get the effect
      2. Run /effect give @s minecraft:speed infinite 0 true
      3. 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.

            Unassigned Unassigned
            clamlol clam lol
            Votes:
            10 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              CHK: