hide nameplates on invisible players

This commit is contained in:
2023-08-01 19:03:53 +02:00
parent 48284dc0b5
commit 3ab23d0ca5
@@ -13,6 +13,7 @@ import org.bukkit.entity.Player;
import org.bukkit.entity.TextDisplay;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.util.Transformation;
import org.jetbrains.annotations.NotNull;
import org.joml.AxisAngle4f;
@@ -142,6 +143,10 @@ public class Nameplate {
remove();
return;
}
if (player.hasPotionEffect(PotionEffectType.INVISIBILITY)) {
remove();
return;
}
createDisplayEntity();
if (textDisplay == null || textDisplay.isDead()) return;