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