AquaticChargeAttackGoal 5.47.0
Extends Goal
Vanilla behavior.aquatic_charge_attack (nautilus, zombie nautilus): a swimming mob dashes in a straight line through its attack target, hits it once on the way (attack_reach 0: the bounding boxes touch) with extra knockback, keeps going for charge_overshoot_distance blocks past where the target was, and waits charge_cooldown_time before the next charge. A charge ends after max_charge_distance blocks at most. A target farther than that is first approached at the normal swimming speed (it has to be seen to start the charge).
The charge direction is chosen when the charge starts (Java ChargeAttack: a fixed velocity), so a target that moves away is missed. All the work is per-tick arithmetic on the running goal; nothing is searched.
Properties
$approachSpeed
public float $approachSpeed$chargeSpeed
public float $chargeSpeed$condition
public ?\Closure $condition$cooldownTicks
public int $cooldownTicks$damage
public float $damage$followRange
public float $followRange$knockback
public float $knockback$maxChargeDistance
public float $maxChargeDistance$mob
public \pocketmine\entity\Mob $mob$overshoot
public float $overshoot$stopSwimming
public \Closure $stopSwimming$swimTowards
public \Closure $swimTowardsMethods
__construct()
public function __construct(\pocketmine\entity\Mob $mob, \Closure $swimTowards, \Closure $stopSwimming, float $chargeSpeed, float $approachSpeed, float $damage, float $knockback, float $maxChargeDistance = 16.0, float $overshoot = 1.5, int $cooldownTicks = 80, float $followRange = 32.0, ?\Closure $condition = null)canContinue()
public function canContinue() : boolcanStart()
public function canStart() : boolgetFlags()
public function getFlags() : intisCharging()
public function isCharging() : boolReturns whether the mob is dashing at its target (as opposed to swimming closer or not attacking).
start()
public function start() : voidstop()
public function stop() : voidtick()
public function tick() : void