Skip to content

DelayedMeleeAttackGoal 5.47.0 ​

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

Extends MeleeAttackGoal

Melee attack with a wind-up (vanilla behavior.delayed_attack, the ravager's): when the target is in reach the attack starts, the hit lands $hitDelay ticks later if the target is still in reach, and the attack ends after $attackDuration ticks. A new attack starts at most every $attackInterval ticks.

Clients animate the attack from its start to its end (the DELAYED_ATTACKING flag, query.is_delayed_attacking), so the mob shows it through the $onAttackingChange callback.

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\Mob $mob, float $speedMultiplier, float $damage, float $followRange, int $attackDuration, int $hitDelay, int $attackInterval, ?\Closure $onAttackingChange = null, ?float $reachMultiplier = null)

isAttacking() ​

php
public function isAttacking() : bool

performAttack() protected ​

php
protected function performAttack(\pocketmine\entity\Living $target) : void

stop() ​

php
public function stop() : void

tick() ​

php
public function tick() : void

VanillaMine is a fork of PocketMine-MP. Not affiliated with the PMMP team or Mojang.