StompTurtleEggGoal 5.47.0
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
public const STOMP_TICKS = 60Ticks of stomping on the eggs before they break (Java RemoveBlockGoal: more than 60).
Properties
$goalRadius
public float $goalRadius$interval
public int $interval$mob
public \pocketmine\entity\Mob $mob$searchHeight
public int $searchHeight$searchRange
public int $searchRange$speedMultiplier
public float $speedMultiplierMethods
__construct()
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()
public function canContinue() : boolcanStart()
public function canStart() : boolfindNearestEgg()
public static function findNearestEgg(\pocketmine\world\World $world, int $x, int $y, int $z, int $range, int $height) : ?\pocketmine\math\Vector3Returns the nearest turtle egg with two free blocks above it (Java RemoveBlockGoal.isValidTarget()) within $range blocks horizontally and $height blocks vertically, or null.
getFlags()
public function getFlags() : intgetTarget()
public function getTarget() : ?\pocketmine\math\Vector3Returns the eggs the mob is going to or stomping on, null when the goal isn't running.
start()
public function start() : voidstop()
public function stop() : voidtick()
public function tick() : void