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