public function setMotion(Vector3 $motion)
{
if (!$this->justCreated) {
$this->server->getPluginManager()->callEvent($ev = new EntityMotionEvent($this, $motion));
if ($ev->isCancelled()) {
return false;
}
}
$this->motionX = $motion->x;
$this->motionY = $motion->y;
$this->motionZ = $motion->z;
if (!$this->justCreated) {
$this->updateMovement();
}
return true;
}