diff --git a/src/main/java/net/Indyuce/mmocore/listener/PlayerListener.java b/src/main/java/net/Indyuce/mmocore/listener/PlayerListener.java index 9dde416c..40690760 100644 --- a/src/main/java/net/Indyuce/mmocore/listener/PlayerListener.java +++ b/src/main/java/net/Indyuce/mmocore/listener/PlayerListener.java @@ -56,6 +56,7 @@ public class PlayerListener implements Listener { */ @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void d(EntityDamageByEntityEvent event) { + if(event.getEntity().hasMetadata("NPC")) return; if (event.getEntity() instanceof Player) PlayerData.get((Player) event.getEntity()).updateCombat(); diff --git a/src/main/java/net/Indyuce/mmocore/listener/event/PlayerAttackEventListener.java b/src/main/java/net/Indyuce/mmocore/listener/event/PlayerAttackEventListener.java index e08c4ace..a1f00c75 100644 --- a/src/main/java/net/Indyuce/mmocore/listener/event/PlayerAttackEventListener.java +++ b/src/main/java/net/Indyuce/mmocore/listener/event/PlayerAttackEventListener.java @@ -47,7 +47,7 @@ public class PlayerAttackEventListener implements Listener { * check damage systems from other MMOCore plugins + from MMOCore, and * register an attack damage for easier plugin calculations */ - if (damager instanceof Player) + if (damager instanceof Player && !damager.hasMetadata("NPC")) Bukkit.getPluginManager().callEvent(new PlayerAttackEvent(PlayerData.get((Player) damager), event, MMOCore.plugin.damage.findInfo(event.getEntity()).merge(info))); /*