Skip to content

HopControl 5.46.0 ​

final class · pocketmine\entity\ai\hostile\HopControl · source

Movement of mobs that only move by hopping (slimes, magma cubes, sulfur cubes; vanilla movement.jump and the slime_* behaviours): they face a direction and, every jump delay, leap forward. They don't move on the ground between hops.

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\Mob $mob, array $calmDelay, array $aggressiveDelay)

computeMotion() ​

php
public function computeMotion(\pocketmine\math\Vector3 $motion, float $hopSpeed, float $jumpVelocity, bool $inWater) : \pocketmine\math\Vector3

Returns the motion of the mob for this tick (gravity and drag included).

getDirection() ​

php
public function getDirection() : float

hasLanded() ​

php
public function hasLanded() : bool

Whether the mob touched the ground at the end of a hop during the last movement update.

isAggressive() ​

php
public function isAggressive() : bool

setDirection() ​

php
public function setDirection(float $yaw, bool $aggressive) : void

setWantsToMove() ​

php
public function setWantsToMove(bool $wantsToMove) : void

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.