diff --git a/pom.xml b/pom.xml
index b873ff4..e8534a8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -74,7 +74,7 @@
org.projectlombok
lombok
- 1.18.20
+ 1.18.30
provided
diff --git a/src/main/java/com/loganmagnan/invisibleplayers/runnables/EntityRunnable.java b/src/main/java/com/loganmagnan/invisibleplayers/runnables/EntityRunnable.java
index 6a43bc7..37825a1 100644
--- a/src/main/java/com/loganmagnan/invisibleplayers/runnables/EntityRunnable.java
+++ b/src/main/java/com/loganmagnan/invisibleplayers/runnables/EntityRunnable.java
@@ -4,6 +4,7 @@ import com.loganmagnan.invisibleplayers.InvisiblePlayers;
import org.bukkit.entity.Creature;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
+import org.bukkit.potion.PotionEffectType;
import java.util.List;
@@ -14,6 +15,10 @@ public class EntityRunnable {
public EntityRunnable() {
this.main.getServer().getScheduler().runTaskTimerAsynchronously(this.main, () -> {
for (Player player : this.main.getServer().getOnlinePlayers()) {
+ 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) {