Skip to content

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() : float

getVelocityY() ​

php
public function getVelocityY() : float

isThreeDimensional() ​

php
public function isThreeDimensional() : bool

Flying 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) : void

stop() ​

php
public function stop() : void

tick() ​

php
public function tick() : void

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.