Check NPC spawned

This commit is contained in:
fullwall 2023-02-02 18:48:27 +08:00
parent b21af8dd6e
commit f759c81763
1 changed files with 2 additions and 0 deletions

View File

@ -92,6 +92,8 @@ public class ScoreboardTrait extends Trait {
if (team == null || name == null || !team.hasEntry(name))
return;
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), () -> {
if (npc.isSpawned())
return;
if (team.getSize() == 1) {
for (Player player : Bukkit.getOnlinePlayers()) {
metadata.remove(player.getUniqueId(), team.getName());