[SPIGOT-678] PotionEffect Not Implemented Fully Created: 11/Mar/15  Updated: 11/Mar/15  Resolved: 11/Mar/15

Status: Closed
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Chris Lutte Assignee: Thinkofname
Resolution: Fixed Votes: 0
Labels: bug, nbt
Environment:

NA



 Description   

PotionEffect is not fully implemented. This is in regards to "ShowParticles" , looking at the source, your constructor takes the Boolean for particles, but apart from assigning it to a field, it never gets used. The outcome of this is that you can't hide the particles from any Potion or Potion effect.

I have tested this in every possible combination, but I won't list any of them unless you require it. If you just look at the PotionEffect source it will be very clear that I am talking about. Once its fully implemented I will then re run all the tests, but there isn't much point until PotionEffect is fixed.

PS- Obviously this has a effect on PotionMeta and serialization but the one fix should hopefully fix it all.

Please let me know if you require any more info.

Regards.



 Comments   
Comment by Chris Lutte [ 11/Mar/15 ]

Confirmed fixed in latest build of 1.8.3.

Comment by Chris Lutte [ 11/Mar/15 ]

I thought this would happen, I was just going to see what happened. Mojang has backwards logic when it comes to naming AND setting the visibility of particles on Potion Effects.

They actually use "Hide Particles" in the description of the effects command, as this suggests you need to set it to true to "Hide Particles". This is actually how it works, regardless of internally its tagged "ShowParticles" the value still has to be set to true to "Hide the particles". Only mojang could have logic like that lol its so backwards.

If I set in Spigot API when creating a PotionEffect, particles to false it does hide the particles but if you serialize it, it reverses it back to true.

Here is what you see. I did the following, created Effect saved it and applied it to player. Then I tested for any effect now applied to the player and saved that to file as well. Here is the results.

As you can see the original set to false, and no particles are displayed on the player. But getting the applied effect you see its now set to true. Yes its a mess thanks Mojang !!

Will leave it up to us to decide which way round you want it. Personally it feels more natural to set particles to true and they are hidden.

my:
pot:
original:
==: PotionEffect
effect: 5
duration: 10000000
amplifier: 25
ambient: true
has-particles: false
applied:
==: PotionEffect
effect: 5
duration: 10000000
amplifier: 25
ambient: true
has-particles: true

Comment by Chris Lutte [ 11/Mar/15 ]

Just rebuilding now and will run the tests.

Comment by Chris Lutte [ 11/Mar/15 ]

Do you need anything else for the time being, as soon as you push a fix I will re test everything for you.

Comment by Thinkofname [ 11/Mar/15 ]

Found the places you were talking about, you were really specific enough

Comment by Thinkofname [ 11/Mar/15 ]

https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java#303

Generated at Sat Mar 29 11:34:46 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.