FlyingMoveControl 5.46.0
class · pocketmine\entity\ai\control\FlyingMoveControl · source
Extends MoveControl
Move control of flying mobs (bats, bees, parrots, allays, happy ghasts): moves straight towards the wanted position in three dimensions at the flying speed times the speed multiplier. Flying mobs have no gravity (Mob::tryChangeMovement() applies air drag instead).
The flying speed is in blocks per tick; Bedrock's "flying_speed" values are used as the speed at multiplier 1 (e.g. bee 0.15), which matches the speeds seen in game closely enough.
Methods
__construct()
php
public function __construct(\pocketmine\entity\Mob $mob, float $flyingSpeed)getFlyingSpeed()
php
public function getFlyingSpeed() : floatgetVelocityY()
php
public function getVelocityY() : floatisThreeDimensional()
php
public function isThreeDimensional() : boolFlying while the mob has no gravity: mobs that land (a sitting parrot, a resting bat) turn their gravity on.
setFlyingSpeed()
php
public function setFlyingSpeed(float $flyingSpeed) : voidstop()
php
public function stop() : voidtick()
php
public function tick() : void