use pocketmine\math\Vector3; use pocketmine\network\mcpe\NetworkSession; class SetActorMotionPacket extends DataPacket{ public const NETWORK_ID = ProtocolInfo::SET_ACTOR_MOTION_PACKET; /** @var int */ public $entityRuntimeId; /** @var Vector3 */ public $motion; protected function decodePayload(){ $this->entityRuntimeId = $this->getEntityRuntimeId(); $this->motion = $this->getVector3(); } protected function encodePayload(){ $this->putEntityRuntimeId($this->entityRuntimeId); $this->putVector3($this->motion); } public function handle(NetworkSession $session) : bool{ return $session->handleSetActorMotion($this); } }