I have class Arena.php and Main.php in Main.php I am registering spawns etc PHP: public function onEnable(){$this->setArenasData();}public function setArenasData(){ $this->areny["TowerFall"] = ['lobby' => new Position(-16, 181, 0, $this->getServer()->getLevelByName("mm-towerfall")), 'level' => $this->getServer()->getLevelByName("mm-towerfall"), '1spawn' => new Vector3(7, 142, -4), '2spawn' => new Vector3(23, 142, 10), '3spawn' => new Vector3(9, 151, 13), '4spawn' => new Vector3(21, 151, 21), '5spawn' => new Vector3(16, 151, 6)];} in class Arena.php I have in constructor PHP: /** var Main $plugin */$this->data = $plugin->areny[$id]; It make me able to get something from $this->areny in Arena.php now I trying to teleport player like this: PHP: $player->teleport($this->data['lobby']); // new Position(-16, 181, 0, $this->getServer()->getLevelByName("mm-towerfall"); Player get teleported, but he dont move to world "mm-towerfall" it only teleport him to coords -16, 181, 0 I tried to teleport player using Position.php without getting position from $this->data and it worked perfectly, so what is bad? PHP: $player->teleport(new Position(-16, 181, 0, Server::getInstance()->getLevelByName("mm-towerfall"))); //Working :v Level mm-towerfall is 100% loaded.
You suck at passing a Position parameter to Entity::teleport() :/ Send the output of var_dump($this->data["lobby"])
Code: object(pocketmine\level\Position)#11192 (4) { ["level"]=> NULL ["x"]=> int(-16) ["y"]=> int(181) ["z"]=> int(0) } I do not understand why level is null, it is loaded