diff --git a/plugin/src/main/java/net/thenextlvl/protect/listener/EntityListener.java b/plugin/src/main/java/net/thenextlvl/protect/listener/EntityListener.java index 932b24a..8010448 100644 --- a/plugin/src/main/java/net/thenextlvl/protect/listener/EntityListener.java +++ b/plugin/src/main/java/net/thenextlvl/protect/listener/EntityListener.java @@ -53,7 +53,8 @@ public void onEntityDamageByEntity(EntityDamageByEntityEvent event) { var area = plugin.areaProvider().getArea(event.getDamager()); var flag = event.getDamager() instanceof Player && event.getEntity() instanceof Player ? plugin.flags.playerAttackPlayer : event.getDamager() instanceof Player - ? plugin.flags.playerAttackEntity : event.getEntity() instanceof Player + ? plugin.flags.playerAttackEntity : !(event.getDamager() instanceof Player) + && event.getEntity() instanceof Player ? plugin.flags.entityAttackPlayer : plugin.flags.entityAttackEntity; event.setCancelled(!area.getFlag(flag)); }