diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index b5052e1a1e..6091f1a34f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -861,7 +861,7 @@ public class CraftWorld implements World { Class bukkitClass = bukkitEntity.getClass(); - if (clazz.isAssignableFrom(bukkitClass)) { + if (clazz.isAssignableFrom(bukkitClass) && bukkitEntity.isValid()) { list.add((T) bukkitEntity); } } @@ -885,7 +885,7 @@ public class CraftWorld implements World { Class bukkitClass = bukkitEntity.getClass(); for (Class clazz : classes) { - if (clazz.isAssignableFrom(bukkitClass)) { + if (clazz.isAssignableFrom(bukkitClass) && bukkitEntity.isValid()) { list.add(bukkitEntity); break; }