PHP: $pos2 = new Position(12, 66, 30, $this->plugin->getServer()->getLevelByName("Lobby2"));$p->teleport($pos2, 0, 0); Code: [19:49:01] [Server thread/CRITICAL]: "Could not pass event 'pocketmine\event\player\PlayerJoinEvent' to 'Core v1': Call to a member function getServer() on null on Core\EventListener [19:49:01] [Server thread/CRITICAL]: Error: "Call to a member function getServer() on null" (EXCEPTION) in "myzip:///Core.zip#Core/src/Core/EventListener" at line 60
You might want to show your whole event listener for this. Looking at this, it looks fine. There's probably something wrong in the constructor.
Oh I forgot to use constructor Now i used this and console said Code: [20:07:16] [Server thread/CRITICAL]: TypeError: "Argument 1 passed to Core\EventListener::__construct() must be an instance of Core\Core, none given, called in myzip:///root/server/plugins/Core.zip#Core/src/Core/Core.php on line 22" (EXCEPTION) in "myzip:///Core.zip#Core/src/Core/EventListener" at line 32 PHP: public function __construct(Core $plugin) { $this->plugin = $plugin; parent::__construct($plugin);}
You didn't pass your core object example (if you are constructing from your Core class) new ListenerClassName($this); where $this is an instance of the Core class