use pocketmine\network\mcpe\NetworkSession; class SetEntityMotionPacket extends DataPacket{ const NETWORK_ID = ProtocolInfo::SET_ENTITY_MOTION_PACKET; public $entityRuntimeId; public $motionX; public $motionY; public $motionZ; public function decode(){ $this->entityRuntimeId = $this->getEntityRuntimeId(); $this->getVector3f($this->motionX, $this->motionY, $this->motionZ); } public function encode(){ $this->reset(); $this->putEntityRuntimeId($this->entityRuntimeId); $this->putVector3f($this->motionX, $this->motionY, $this->motionZ); } public function handle(NetworkSession $session) : bool{ return $session->handleSetEntityMotion($this); } }