diff --git a/src/API/PlayerAPI.php b/src/API/PlayerAPI.php index b82585dec3..b4dfa9f958 100644 --- a/src/API/PlayerAPI.php +++ b/src/API/PlayerAPI.php @@ -136,7 +136,7 @@ class PlayerAPI{ if(count($params) === 3){ $spawn = new Position(floatval(array_shift($params)), floatval(array_shift($params)), floatval(array_shift($params)), $issuer->level); }else{ - $spawn = new Position($issuer->x, $issuer->y, $issuer->z, $issuer->level); + $spawn = new Position($issuer->entity->x, $issuer->entity->y, $issuer->entity->z, $issuer->entity->level); } $target->setSpawn($spawn); diff --git a/src/Player.php b/src/Player.php index ba29706706..a64b66de50 100644 --- a/src/Player.php +++ b/src/Player.php @@ -968,7 +968,6 @@ class Player{ $this->server->schedule(50, array($this, "orderChunks"), array(), true); $this->blocked = false; $this->teleport(new Position($this->data->get("position")["x"], $this->data->get("position")["y"], $this->data->get("position")["z"], $this->level)); - $this->setSpawn(new Vector3($this->data->get("spawn")["x"], $this->data->get("spawn")["y"], $this->data->get("spawn")["z"]), $this->data->get("spawn")["level"]); break; case 2://Chunk loaded? break;