[SPIGOT-1216] PotionEffectType.createPotionEffect creates wrong durations Created: 30/Sep/15  Updated: 03/Oct/15  Resolved: 03/Oct/15

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

Type: Bug Priority: Minor
Reporter: SL Dev Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: duration, potion, potioneffect


 Description   

While coding, I tried to create a PotionEffect using PotionEffectType.createEffect method.
I inserted the duration, and the duration didn't work.
When I inserted 100 (ticks = 5 seconds), It worked for a bit longer than 1 second, and when I inserted 500 it worked for a bit longer than 5 seconds.

After some testing, I tried creating the effect with the potioneffect constructor and entered 100 ticks, it worked for 100 ticks.

Basically, durations in createEfefct method don't work correctly.



 Comments   
Comment by Black Hole [ 30/Sep/15 ]

Works as intended, since JavaDoc states: "Creates a PotionEffect from the given PotionEffectType, applying duration modifiers and checks."

So some plugins might rely on the behaviour.

Comment by SpigotMC [ 30/Sep/15 ]

Your build is not the latest and therefore may be the reason you are having this issue. Spigot is 18 version(s) behind. CraftBukkit is 44 version(s) behind. This message was automatically generated and is not guaranteed to be a solution to your issue.

Generated at Thu Apr 03 15:45:12 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.