From cf9a84e935c6aca3feb6aa51a7f68496658a22d1 Mon Sep 17 00:00:00 2001 From: Logan Magnan Date: Sun, 22 Sep 2024 10:18:32 -0400 Subject: [PATCH] fixed --- .../invisibleplayers/runnables/EntityRunnable.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/loganmagnan/invisibleplayers/runnables/EntityRunnable.java b/src/main/java/com/loganmagnan/invisibleplayers/runnables/EntityRunnable.java index 37825a1..b17f751 100644 --- a/src/main/java/com/loganmagnan/invisibleplayers/runnables/EntityRunnable.java +++ b/src/main/java/com/loganmagnan/invisibleplayers/runnables/EntityRunnable.java @@ -15,12 +15,12 @@ public class EntityRunnable { public EntityRunnable() { this.main.getServer().getScheduler().runTaskTimerAsynchronously(this.main, () -> { for (Player player : this.main.getServer().getOnlinePlayers()) { + List nearbyEntities = player.getNearbyEntities(this.main.getMainConfig().getConfig().getInt("NEARBY-ENTITIES.RADIUS.X"), this.main.getMainConfig().getConfig().getInt("NEARBY-ENTITIES.RADIUS.Y"), this.main.getMainConfig().getConfig().getInt("NEARBY-ENTITIES.RADIUS.Z")); + if (!player.hasPotionEffect(PotionEffectType.INVISIBILITY)) { continue; } - List nearbyEntities = player.getNearbyEntities(this.main.getMainConfig().getConfig().getInt("NEARBY-ENTITIES.RADIUS.X"), this.main.getMainConfig().getConfig().getInt("NEARBY-ENTITIES.RADIUS.Y"), this.main.getMainConfig().getConfig().getInt("NEARBY-ENTITIES.RADIUS.Z")); - for (Entity entity : nearbyEntities) { if (!(entity instanceof Creature)) { continue;