diff --git a/src/entity/Entity.php b/src/entity/Entity.php index bdcd088a5..46e60feaa 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -803,6 +803,15 @@ abstract class Entity{ $this->server->broadcastPackets($this->hasSpawned, [SetActorMotionPacket::create($this->id, $this->getMotion())]); } + public function getGravity() : float{ + return $this->gravity; + } + + public function setGravity(float $gravity) : void{ + Utils::checkFloatNotInfOrNaN("gravity", $gravity); + $this->gravity = $gravity; + } + public function hasGravity() : bool{ return $this->gravityEnabled; }