SwimmingMobTrait 5.46.0
Mob that lives in water (fish, dolphin, tadpole, nautilus): swimming move control, straight line navigation and wandering targets in water. Out of water it can't wander (fish flop, see the mob). Amphibious mobs (axolotls, turtles, frogs) don't use this: they keep the walking navigation with a SwimmingMoveControl.
Methods
canBeMovedByCurrents()
php
public function canBeMovedByCurrents() : boolcanBreathe()
php
public function canBreathe() : boolcreateMoveControl() protected
php
protected function createMoveControl() : \pocketmine\entity\ai\control\MoveControlcreateNavigation() protected
php
protected function createNavigation() : \pocketmine\entity\ai\navigation\PathNavigatorfindWanderPos()
php
public function findWanderPos(int $horizontal, int $vertical, ?\pocketmine\math\Vector3 $awayFrom = null) : ?\pocketmine\math\Vector3getSwimSpeed() protected
php
abstract protected function getSwimSpeed() : floatUnderwater speed in blocks per tick at speed multiplier 1 (Bedrock "underwater_movement").
