public void onEntityDamage(EntityDamageEvent event) { Entity entity = event.getEntity(); if (!(entity instanceof Player)) { return; } Player player = (Player) entity; if (!plugin.checkAuth(player)) { event.setCancelled(true); } }
public void onEntityTarget(EntityTargetEvent event) { Entity entity = event.getEntity(); if (entity instanceof Player) { return; } Entity target = event.getTarget(); if (!(target instanceof Player)) { return; } Player targetPlayer = (Player) target; if (!plugin.checkAuth(targetPlayer)) { event.setCancelled(true); } }