Skip to content

RangedAttackGoal 5.46.0 ​

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

Extends Goal

Keeps the target at range, strafing around it, and shoots it at a fixed interval (vanilla behavior.ranged_attack with skeleton strafing). The shot itself is done by the callback.

Properties ​

$attackInterval ​

php
public int $attackInterval

$attackRange ​

php
public float $attackRange

$hardAttackInterval ​

php
public int $hardAttackInterval

$mob ​

php
public \pocketmine\entity\Mob $mob

$shoot ​

php
public \Closure $shoot

$speedMultiplier ​

php
public float $speedMultiplier

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\Mob $mob, float $speedMultiplier, int $attackInterval, int $hardAttackInterval, float $attackRange, \Closure $shoot)

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.