Skip to content

RandomBreachGoal 5.47.0 ​

class · pocketmine\entity\ai\goal\RandomBreachGoal · source

Extends Goal

Leaps out of the water (Bedrock behavior.random_breach, dolphins): about once every $interval ticks, when the mob swims just below the surface with open water and air above it for $xzDistance blocks ahead (Java DolphinJumpGoal), it jumps forward with its jump power (Bedrock jump.static) and dives back in. It can't breach again for $cooldownTicks after that. The surface check only runs when the interval roll succeeds.

Constants ​

FORWARD_SPEED ​

php
public const FORWARD_SPEED = 0.6

Forward push of the leap (Java DolphinJumpGoal).

Properties ​

$cooldownTicks ​

php
public int $cooldownTicks

$interval ​

php
public int $interval

$jumpPower ​

php
public float $jumpPower

$mob ​

php
public \pocketmine\entity\Mob $mob

$xzDistance ​

php
public int $xzDistance

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\Mob $mob, int $interval = 50, int $xzDistance = 6, int $cooldownTicks = 40, float $jumpPower = 0.6)

canBreachHere() ​

php
public function canBreachHere() : bool

Whether the mob is in water just below the surface, with water at its level and two blocks of air above it for $xzDistance blocks in the direction it faces.

canContinue() ​

php
public function canContinue() : bool

canStart() ​

php
public function canStart() : bool

getFlags() ​

php
public function getFlags() : int

isBreaching() ​

php
public function isBreaching() : bool

Returns whether the mob is leaping right now.

isInterruptible() ​

php
public function isInterruptible() : bool

start() ​

php
public function start() : void

stop() ​

php
public function stop() : void

tick() ​

php
public function tick() : void

VanillaMine is a fork of PocketMine-MP. Not affiliated with the PMMP team or Mojang.