public function onEnable(){ $this->getServer()->getPluginManager()->registerEvents($this, $this); $this->getServer()->getPluginManager()->registerEvents(new test($this), $this); }
Obviously you don't know enough PHP to even be a Newbie developer. BTW, you r test.php, does it listen to events, or do other things? Use a new class: new Test(); Theee are a lot of tutorials about PHP OOP. Google it
In the main class, create a function to access to test.php (Inside test.php create a class called Test) PHP: public function getTestFile(){ return new path\Test($this, $other_arguments=null);} In test.php, PHP: class Test{ private $plugin; public function __construct($plugin){ $this->plugin = $plugin; } }