@EventHandler public void onPlayerAttack(EntityDamageByEntityEvent e) { if (e.getDamager() instanceof Player) { Player p = (Player) e.getDamager(); if (ArenaManager.getInstance().getArena(p) != null) e.setCancelled(true); } }
@EventHandler public void onPlayerDamage(EntityDamageEvent e) { if (e.getEntity() instanceof Player) { Player p = (Player) e.getEntity(); if (ArenaManager.getInstance().getArena(p) != null) { if (e.getCause() != DamageCause.ENTITY_ATTACK) e.setCancelled(true); } } }