diff --git a/src/pocketmine/entity/Entity.php b/src/pocketmine/entity/Entity.php index 3ab901e9f..0325b7743 100644 --- a/src/pocketmine/entity/Entity.php +++ b/src/pocketmine/entity/Entity.php @@ -1121,7 +1121,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{ $this->broadcastMovement($teleport); } - if($diffMotion > 0.0025 or ($diffMotion > 0.0001 and $this->getMotion()->lengthSquared() <= 0.0001)){ //0.05 ** 2 + if($diffMotion > 0.0025 or ($diffMotion > 0.0001 and $this->motion->lengthSquared() <= 0.0001)){ //0.05 ** 2 $this->lastMotion = clone $this->motion; $this->broadcastMotion(); @@ -1812,7 +1812,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{ } public function getMotion() : Vector3{ - return $this->motion; + return clone $this->motion; } public function setMotion(Vector3 $motion) : bool{