Initial commit, working on a local server #31
20
killpotdisable.py
Normal file
20
killpotdisable.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
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
|
Reference in New Issue
Block a user