I found how spawn, $pos=$p->getPosition(); How to make $pos independent of $p? I need to specify the numbers in the $pos me it should not depend on the position of the player.
$p itself is the Position. $p->getPosition() is only to make the coordinates not change due to other references on the same object changing its position, which is useful when you want to save the position over time (i.e. save it outside the context of an event handler) without cloning the player object. You can construct a new position object using the Position constructor. Method declaration: PHP: public function \pocketmine\level\Position::__construct(number $x, number $y, number $z, Level $level = null);