diff --git a/varo/src/main/java/de/cliffbreak/varo/managers/NPCManager.java b/varo/src/main/java/de/cliffbreak/varo/managers/NPCManager.java index 61a6ee2..a79b39e 100644 --- a/varo/src/main/java/de/cliffbreak/varo/managers/NPCManager.java +++ b/varo/src/main/java/de/cliffbreak/varo/managers/NPCManager.java @@ -51,6 +51,7 @@ public class NPCManager { private final Varo plugin; private final ArrayList npcs = new ArrayList(); + private final ArrayList isDying = new ArrayList(); private final HashMap inventories = new HashMap(); private final Scoreboard scoreboard; private Team afkTeam; @@ -175,6 +176,10 @@ public class NPCManager { if (isCritical) world.playSound(loc, Sound.ENTITY_PLAYER_ATTACK_CRIT, 1.0F, 1.0F); } else { + if (this.isDying.contains(npc.getId())) { + return; + } + this.isDying.add(npc.getId()); // Send Death Animation Packet for (final Player connectionPlayer : Bukkit.getOnlinePlayers()) { final PlayerConnection connection = ((CraftPlayer) connectionPlayer) @@ -225,6 +230,7 @@ public class NPCManager { connection.sendPacket(new PacketPlayOutEntityDestroy(npc.getId())); } this.npcs.remove(npc); + this.isDying.remove(npc.getId()); } } }