How i can check if a player has an infinite potion effect? (The type of the potion does no matter) ej:
I have never really worked with this but have you tried what #getDuration() of the PotionEffects Class returns when the effect is infinite?
Well the best approach would be to test this and then just check if #getDuration() is greater or equal to the 60-30 mins in ticks.
PotionEffect becomes infinite when its duration goes beyond 1638 seconds (durationInSeconds >= 1639). As far as I remember, PotionEffect#getDuration() returns duration in milliseconds so you need to compare it with 1639000. - DelfikPro.