So, I enter cmd "/spawn" and then there is a crash. What is the problem? If I don't give enough info about problem, I can give more. PHP: private function XYZWfromPlayerTo($evt) { return array( "xto" => $evt->getTo()->x, "yto" => $evt->getTo()->y, "zto" => $evt->getTo()->z, "wto" => $evt->getTo()->level->getName()); //127 line }public function onEntityTeleport(EntityTeleportEvent $evt) { $player = $evt->getEntity(); if ($player instanceof Player) { extract($this->XYZWfromPlayerTo($evt)); }} Code: Error: Call to a member function getName() on null Line: 127 (getting name of level) Type: E_ERROR
I don't sure, but may will it be a problem with spawn coords?.. YES, EURICA! In plugin where this cmd checks, there I use "....(new Pos(x,y,z)..." and DON'T pass the world name!!! There is in the core, exact in Posintion.php constructor, "public function __construct($x = 0, $y = 0, $z = 0, Level $level = null)", so I passed NULLED world. I'm sorry guys!