Can I register an event listener from another non-main-plugin class? I have this in a class called Arena.php: PHP: $this->plugin->getServer()->getPluginManager()->registerEvents(new EventHandler($this), $this); Where $this->plugin is the Main class instance. I want to have different EventHandlers for every arena. It throws me an error and crashes... (The error says the second parameter needs to be a Main class, not Arena class itself) What can I do to fix this? Is there an another way? Also, I get also an error: Invalid owner of PluginTask LOL\TimerTask. I didin Arena.php: PHP: $this->timer = new TimerTask($this); $h = $this->plugin->getServer()->getScheduler()->scheduleRepeatingTask($this->timer, 20); $this->timer->setHandler($h); How can I fix this?
Try PHP: $this->plugin->getServer()->getPluginManager()->registerEvents(new EventHandler($this), $this->plugin);