This repository has been archived on 2024-08-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
redstoner-utils/killpotdisable.py
2015-12-28 13:05:20 +01:00

21 lines
587 B
Python

import org.bukkit.potion.PotionEffect as PotionEffect
import org.bukkit.potion.PotionEffectType as PotionEffectType
@hook.event("entity.PotionSplashEvent", "high")
def on_splash(event):
potion_effects = event.getPotion().getEffects()
for eff in potion_effects:
if eff.getType() == PotionEffectType.HEAL:
if eff.getAmplifier() > 250:
event.setCancelled(True)
break
elif eff.getType() == PotionEffectType.HARM:
if eff.getAmplifier() > 250:
event.setCancelled(True)
break