diff --git a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java index 35a163ff0..deda47113 100644 --- a/src/main/java/com/gmail/nossr50/listeners/EntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/EntityListener.java @@ -75,11 +75,19 @@ public class EntityListener implements Listener { } } - if (attacker instanceof Player && defender instanceof Player) { - if (PartyManager.getInstance().inSameParty((Player) defender, (Player) attacker)) { - event.setCancelled(true); + if (defender instanceof Player) { + Player defendingPlayer = (Player) defender; + + if (!defendingPlayer.isOnline()) { return; } + + if (attacker instanceof Player) { + if (PartyManager.getInstance().inSameParty(defendingPlayer, (Player) attacker)) { + event.setCancelled(true); + return; + } + } } /* Check for invincibility */