MeleeAttackGoal 5.46.0
Extends Goal
Chases the attack target and hits it when in reach (vanilla behavior.melee_attack / melee_box_attack).
Constants
ATTACK_INTERVAL
php
public const ATTACK_INTERVAL = 20Properties
$damage
php
public float $damage$followRange
php
public float $followRange$mob
php
public \pocketmine\entity\Mob $mob$speedMultiplier
php
public float $speedMultiplierMethods
__construct()
php
public function __construct(\pocketmine\entity\Mob $mob, float $speedMultiplier, float $damage, float $followRange = 35.0)canStart()
php
public function canStart() : boolgetFlags()
php
public function getFlags() : intgetReachSquared() protected
php
protected function getReachSquared(\pocketmine\entity\Living $target) : floatSquared reach distance (vanilla: (2 * width)^2 + target width, plus some slack for the box attack).
start()
php
public function start() : voidstop()
php
public function stop() : voidtick()
php
public function tick() : void