LongJumpGoal 5.46.0
Extends Goal
Jumps up onto a high block (vanilla behavior.jump_to_block, used by goats): every 30-60 seconds an idle mob on the ground looks for a standable block 2 to 10 blocks higher within 10 blocks sideways which it couldn't simply walk up to, and leaps there in one ballistic jump (JUMP_GOAL_JUMP flag while in the air). The jump is computed with the server's physics (gravity 0.08, drag 0.02 per tick) and only made if nothing is in the way.
Simplification: Bedrock's minimum_path_length (the block must be at least 8 path nodes away) is approximated by requiring a height difference of at least 2 blocks, which a walking mob can't climb in one step.
Constants
ATTEMPTS
public const ATTEMPTS = 24Candidate positions tried per search.
MAX_FLIGHT_TICKS
public const MAX_FLIGHT_TICKS = 60MAX_VELOCITY
public const MAX_VELOCITY = 1.5MIN_HEIGHT
public const MIN_HEIGHT = 2SEARCH_HEIGHT
public const SEARCH_HEIGHT = 10SEARCH_WIDTH
public const SEARCH_WIDTH = 10Properties
$maxCooldownTicks
public int $maxCooldownTicks$minCooldownTicks
public int $minCooldownTicks$mob
public \pocketmine\entity\Mob $mob$onJumpingChanged
public ?\Closure $onJumpingChangedMethods
__construct()
public function __construct(\pocketmine\entity\Mob $mob, int $minCooldownTicks = 600, int $maxCooldownTicks = 1200, ?\Closure $onJumpingChanged = null)canContinue()
public function canContinue() : boolcanStart()
public function canStart() : boolcomputeJump()
public function computeJump(\pocketmine\math\Vector3 $from, \pocketmine\math\Vector3 $to) : ?\pocketmine\math\Vector3Returns the launch velocity of a jump from $from landing on $to, or null if there is none within the maximum velocity or something is in the way.
getFlags()
public function getFlags() : intisJumping()
public function isJumping() : boolresetCooldown()
public function resetCooldown() : voidMakes the next search happen right away (tests, plugins).
start()
public function start() : voidstop()
public function stop() : voidtick()
public function tick() : void