Skip to content

FreeMeleeAttackGoal 5.46.0 ​

class · pocketmine\entity\ai\hostile\goal\FreeMeleeAttackGoal · source

Extends Goal

Flies or swims straight at the attack target and hits it when their bounding boxes (grown by $reach) touch (vanilla charge_attack of vexes, aquatic charges, drowned swimming at their target).

Properties ​

$attackInterval ​

php
public int $attackInterval

$condition ​

php
public ?\Closure $condition

$control ​

php
public \pocketmine\entity\ai\hostile\FreeMoveControl $control

$damage ​

php
public float $damage

$followRange ​

php
public float $followRange

$mob ​

php
public \pocketmine\entity\Mob $mob

$onHit ​

php
public ?\Closure $onHit

$reach ​

php
public float $reach

$speed ​

php
public float $speed

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\Mob $mob, \pocketmine\entity\ai\hostile\FreeMoveControl $control, float $speed, float $damage, float $reach = 0.2, int $attackInterval = 20, float $followRange = 32.0, ?\Closure $condition = null, ?\Closure $onHit = null)

canStart() ​

php
public function canStart() : bool

getFlags() ​

php
public function getFlags() : int

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.