Hi, this is my code, CitizensEnableEvent is fired as it should be and the message is logged, however the NPCLeftClickEvent (and right) are not. No matter if it's this npc spawned through code or through /npc create command. When I click them nothing happens. What did I miss?```java
public class NPCManager implements Listener, CommandExecutor {
private Main plugin;
private final NPCRegistry registry = CitizensAPI.createAnonymousNPCRegistry(new MemoryNPCDataStore());
public NPCManager(Main plugin) {
this.plugin = plugin;
Bukkit.getPluginManager().registerEvents(this, plugin);
}
@EventHandler
public void onCitizensEnable(CitizensEnableEvent event) {
plugin.getLogger().info("CitizensEnableEvent called!");
CitizensAPI.registerEvents(this);
}
@EventHandler
public void npcLeftClick(NPCLeftClickEvent event) {
plugin.getLogger().info("NPCLeftClickEvent player=" + event.getClicker().getName() + " npc=" + event.getNPC().getName());
}
@EventHandler
public void npcRightClick(NPCRightClickEvent event) {
plugin.getLogger().info("NPCRightClickEvent player=" + event.getClicker().getName() + " npc=" + event.getNPC().getName());
}
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
if (args.length == 0 || !(sender instanceof Player player))
return false;
if (args[0].equalsIgnoreCase("spawn")) {
NPC npc = registry.createNPC(EntityType.PLAYER, args[1]);
npc.spawn(player.getLocation().clone().add(0, -2, 0));
if (args.length >= 3 && args[2].equals("withtrait")) {
player.sendMessage("Spawned npc with trait!");
npc.addTrait(new TestTrait());
}
}
return true;
}
}``````java
// in onEnable
this.npcManager = new NPCManager(this);
getCommand("mynpc").setExecutor(npcManager);```