diff --git a/api/src/main/java/de/erethon/dungeonsxl/api/player/PlayerCache.java b/api/src/main/java/de/erethon/dungeonsxl/api/player/PlayerCache.java index 38d60f34..c9049db2 100644 --- a/api/src/main/java/de/erethon/dungeonsxl/api/player/PlayerCache.java +++ b/api/src/main/java/de/erethon/dungeonsxl/api/player/PlayerCache.java @@ -148,6 +148,9 @@ public class PlayerCache extends Registry { public Collection getAllGamePlayersIf(Predicate predicate) { Collection checked = new ArrayList<>(); for (GlobalPlayer element : elements.values()) { + if (!(element instanceof GamePlayer)) { + continue; + } GamePlayer gamePlayer = (GamePlayer) element; if (predicate.test(gamePlayer)) { checked.add(gamePlayer);