Skip to content

LayEggGoal 5.46.0 ​

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

Extends Goal

A pregnant animal walks to a suitable block and lays its eggs there (vanilla behavior.lay_egg: frogs lay frogspawn on water, turtles lay eggs on sand). The callbacks decide where and what.

Properties ​

$findTarget ​

php
public \Closure $findTarget

$isPregnant ​

php
public \Closure $isPregnant

$lay ​

php
public \Closure $lay

$mob ​

php
public \pocketmine\entity\Mob $mob

$reach ​

php
public float $reach

$speedMultiplier ​

php
public float $speedMultiplier

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\Mob $mob, \Closure $isPregnant, \Closure $findTarget, \Closure $lay, float $speedMultiplier = 1.0, float $reach = 1.7)

canContinue() ​

php
public function canContinue() : bool

canStart() ​

php
public function canStart() : bool

getFlags() ​

php
public function getFlags() : int

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, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.