use pocketmine\math\Vector3; use pocketmine\network\mcpe\NetworkSession; class ChangeDimensionPacket extends DataPacket{ public const NETWORK_ID = ProtocolInfo::CHANGE_DIMENSION_PACKET; /** @var int */ public $dimension; /** @var Vector3 */ public $position; /** @var bool */ public $respawn = false; protected function decodePayload(){ $this->dimension = $this->getVarInt(); $this->position = $this->getVector3(); $this->respawn = $this->getBool(); } protected function encodePayload(){ $this->putVarInt($this->dimension); $this->putVector3($this->position); $this->putBool($this->respawn); } public function handle(NetworkSession $session) : bool{ return $session->handleChangeDimension($this); } }