Hello, I'm trying to make the NPC visible to the owner only. Here is the code which doesnt seem to be working. Unfortunately I couldnt find any help on any other forum posts on this discord.
minersRegistry = CitizensAPI.createInMemoryNPCRegistry("Miners");
NPC npc = minersRegistry.createNPC(EntityType.PLAYER, "Miner");
PlayerFilter playerFilter = new PlayerFilter();
playerFilter.setAllowlist();
playerFilter.addPlayer(owner.getUniqueId());
npc.addTrait(playerFilter);
npc.spawn(location);
I'm on paper version 1.21.4 (#177) and using Citizens-2.0.37-b3714