if (event instanceof EntityDamageByEntityEvent) {
EntityDamageByEntityEvent e = (EntityDamageByEntityEvent) event;
if (npc != null) {
if (e.getDamager() instanceof Player) {
Player player = (Player) e.getDamager();
npc.callLeftClick(player, npc);
}
} else if (e.getDamager() instanceof Player) {
CreatureTask.onDamage(e.getEntity(), event);
}
}