Skip to content

MeleeAttackGoal 5.46.0 ​

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

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 = 20

Properties ​

$damage ​

php
public float $damage

$followRange ​

php
public float $followRange

$mob ​

php
public \pocketmine\entity\Mob $mob

$speedMultiplier ​

php
public float $speedMultiplier

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\Mob $mob, float $speedMultiplier, float $damage, float $followRange = 35.0)

canStart() ​

php
public function canStart() : bool

getFlags() ​

php
public function getFlags() : int

getReachSquared() protected ​

php
protected function getReachSquared(\pocketmine\entity\Living $target) : float

Squared reach distance (vanilla: (2 * width)^2 + target width, plus some slack for the box attack).

start() ​

php
public function start() : void

stop() ​

php
public function stop() : void

tick() ​

php
public function tick() : void

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