Skip to content

StompTurtleEggGoal 5.47.0 ​

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

Extends Goal

Walks to a turtle egg nearby and stomps on it until it breaks (vanilla behavior.stomp_turtle_egg of zombies, husks, zombie villagers and drowned; Java ZombieAttackTurtleEggGoal, a RemoveBlockGoal): once within the goal radius of the eggs the mob hops up and down on them with the stomping sound for 3 seconds, then the eggs are gone. Needs mobGriefing.

The search runs once every $interval ticks (Bedrock: a 1 in interval chance per tick), and first skips every subchunk of the searched box whose palette has no turtle egg: where there are no eggs it costs a few palette checks.

Constants ​

STOMP_TICKS ​

php
public const STOMP_TICKS = 60

Ticks of stomping on the eggs before they break (Java RemoveBlockGoal: more than 60).

Properties ​

$goalRadius ​

php
public float $goalRadius

$interval ​

php
public int $interval

$mob ​

php
public \pocketmine\entity\Mob $mob

$searchHeight ​

php
public int $searchHeight

$searchRange ​

php
public int $searchRange

$speedMultiplier ​

php
public float $speedMultiplier

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\Mob $mob, float $speedMultiplier = 1.0, int $searchRange = 10, int $searchHeight = 2, float $goalRadius = 1.14, int $interval = 20)

canContinue() ​

php
public function canContinue() : bool

canStart() ​

php
public function canStart() : bool

findNearestEgg() ​

php
public static function findNearestEgg(\pocketmine\world\World $world, int $x, int $y, int $z, int $range, int $height) : ?\pocketmine\math\Vector3

Returns the nearest turtle egg with two free blocks above it (Java RemoveBlockGoal.isValidTarget()) within $range blocks horizontally and $height blocks vertically, or null.

getFlags() ​

php
public function getFlags() : int

getTarget() ​

php
public function getTarget() : ?\pocketmine\math\Vector3

Returns the eggs the mob is going to or stomping on, null when the goal isn't running.

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.