KineticWeaponGoal 5.47.0
Extends Goal
Spear charges of mobs holding a spear (vanilla behavior.use_kinetic_weapon of zombies, husks and zombie villagers; Java SpearUseGoal): the mob walks up to its target until it is within $approachDistance, lowers the spear and charges at it; once next to it (or its path ended) it runs 6-7 blocks away from the target and charges again, until the spear's charge is over. Then it raises the spear and retreats 9-11 blocks away (at most 5 seconds), and the goal ends. While the spear is lowered every living thing it touches is hit like by a player's charge (see Spear), with the mob values of Bedrock: half the reach (weapon_reach_multiplier 0.5), a fifth of the minimum speeds (weapon_min_speed_multiplier 0.2), and the mob's attack damage added to the speed damage (Java KineticWeapon).
A mob riding another mob steers it (hijack_mount_navigation): the mount's own movement goals pause while the goal runs, and the mount's speed decides the hits.
Only runs while the mob has an attack target and holds a spear in its main hand.
Constants
MIN_SPEED_MULTIPLIER
public const MIN_SPEED_MULTIPLIER = 0.2Bedrock weapon_min_speed_multiplier (Java mob action factor): mobs need a fifth of the speeds players need.
REACH_MULTIPLIER
public const REACH_MULTIPLIER = 0.5Bedrock weapon_reach_multiplier: mobs reach half as far as players.
Properties
$approachDistance
public float $approachDistance$baseDamage
public float $baseDamage$condition
public ?\Closure $condition$cooldown
public array $cooldown$cooldownSpeedMultiplier
public float $cooldownSpeedMultiplier$holdsSpear
public ?\Closure $holdsSpear$mainHandItem
public \Closure $mainHandItem$mob
public \pocketmine\entity\Mob $mob$onUsingChanged
public ?\Closure $onUsingChanged$reposition
public array $reposition$repositionSpeedMultiplier
public float $repositionSpeedMultiplier$speedMultiplier
public float $speedMultiplierMethods
__construct()
public function __construct(\pocketmine\entity\Mob $mob, \Closure $mainHandItem, float $baseDamage = 3.0, float $approachDistance = 10.0, array $reposition = [6, 7], array $cooldown = [9, 11], float $speedMultiplier = 1.0, float $repositionSpeedMultiplier = 1.0, float $cooldownSpeedMultiplier = 1.0, ?\Closure $condition = null, ?\Closure $onUsingChanged = null, ?\Closure $holdsSpear = null)canContinue()
public function canContinue() : boolcanStart()
public function canStart() : boolgetFlags()
public function getFlags() : intisCharging()
public function isCharging() : boolWhether the spear is lowered (the charge is on).
start()
public function start() : voidstop()
public function stop() : voidtick()
public function tick() : void