Added Anti-Creeper Glitch To avoid issues with freecam cegging

This commit is contained in:
Driftay 2019-09-18 05:22:05 -04:00
parent 3d45684c6f
commit 0ac6112437

View File

@ -32,6 +32,16 @@ public class FactionsEntityListener implements Listener {
private static final Set<PotionEffectType> badPotionEffects = new LinkedHashSet<>(Arrays.asList(PotionEffectType.BLINDNESS, PotionEffectType.CONFUSION, PotionEffectType.HARM, PotionEffectType.HUNGER, PotionEffectType.POISON, PotionEffectType.SLOW, PotionEffectType.SLOW_DIGGING, PotionEffectType.WEAKNESS, PotionEffectType.WITHER)); private static final Set<PotionEffectType> badPotionEffects = new LinkedHashSet<>(Arrays.asList(PotionEffectType.BLINDNESS, PotionEffectType.CONFUSION, PotionEffectType.HARM, PotionEffectType.HUNGER, PotionEffectType.POISON, PotionEffectType.SLOW, PotionEffectType.SLOW_DIGGING, PotionEffectType.WEAKNESS, PotionEffectType.WITHER));
@EventHandler
public void onCreeperGlitch(EntityDamageEvent e) {
if (!e.getEntity().getType().equals(EntityType.CREEPER)) {
return;
}
if (e.getCause().equals(EntityDamageEvent.DamageCause.DROWNING) || e.getCause().equals(EntityDamageEvent.DamageCause.SUFFOCATION)) {
e.getEntity().remove();
}
}
@EventHandler(priority = EventPriority.NORMAL) @EventHandler(priority = EventPriority.NORMAL)
public void onEntityDeath(EntityDeathEvent event) { public void onEntityDeath(EntityDeathEvent event) {
Entity entity = event.getEntity(); Entity entity = event.getEntity();