Check the NPCRegistry Interface it has what you need to check if one exists. https://jd.citizensnpcs.co/
I tried using this code but it can't tell if any NPCs exist. Code (Text): for(Entity entity: Bukkit.getWorld("world").getEntities()) { if(CitizensAPI.getNPCRegistry().isNPC(entity)) { System.out.println("npc exist!"); } else { System.out.println("no npcs exist!"); } }