Skip to content

CrossbowAttackGoal 5.46.0 ​

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

Extends Goal

Crossbow users (pillagers, piglins): load the crossbow (25 ticks, vanilla charge_held_item), wait 1-2 seconds, then shoot; walk to the target while it's out of range or out of sight and back off when it's too close.

Constants ​

CHARGE_TICKS ​

php
public const CHARGE_TICKS = 25

Properties ​

$attackRange ​

php
public float $attackRange

$minRange ​

php
public float $minRange

$mob ​

php
public \pocketmine\entity\Mob $mob

$onChargingChange ​

php
public \Closure $onChargingChange

$shoot ​

php
public \Closure $shoot

$speedMultiplier ​

php
public float $speedMultiplier

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\Mob $mob, float $speedMultiplier, float $attackRange, float $minRange, \Closure $onChargingChange, \Closure $shoot)

canStart() ​

php
public function canStart() : bool

getFlags() ​

php
public function getFlags() : int

isCharged() ​

php
public function isCharged() : bool

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.