Skip to content

Arrow ​

class · pocketmine\entity\projectile\Arrow · source

Extends Projectile

Constants ​

PICKUP_ANY ​

php
public const PICKUP_ANY = 1

PICKUP_CREATIVE ​

php
public const PICKUP_CREATIVE = 2

PICKUP_NONE ​

php
public const PICKUP_NONE = 0

TAG_CRIT ​

php
public const TAG_CRIT = "crit"

Properties ​

$collideTicks protected ​

php
protected int $collideTicks

$critical protected ​

php
protected bool $critical

$damage protected ​

php
protected float $damage

$pickupMode protected ​

php
protected int $pickupMode

$potionType 5.46.0 protected ​

php
protected ?\pocketmine\item\PotionType $potionType

$punchKnockback protected ​

php
protected float $punchKnockback

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\Location $location, ?\pocketmine\entity\Entity $shootingEntity, bool $critical, ?\pocketmine\nbt\tag\CompoundTag $nbt = null)

canCollideWith() 5.46.0 ​

php
public function canCollideWith(\pocketmine\entity\Entity $entity) : bool

despawnsOnEntityHit() 5.46.0 protected ​

php
protected function despawnsOnEntityHit() : bool

entityBaseTick() protected ​

php
protected function entityBaseTick(int $tickDiff = 1) : bool

getInitialDragMultiplier() protected ​

php
protected function getInitialDragMultiplier() : float

getInitialGravity() protected ​

php
protected function getInitialGravity() : float

getInitialSizeInfo() protected ​

php
protected function getInitialSizeInfo() : \pocketmine\entity\EntitySizeInfo

getNetworkTypeId() ​

php
public static function getNetworkTypeId() : string

getPickupItem() 5.46.0 ​

php
public function getPickupItem() : \pocketmine\item\Item

Returns the item given back when a player picks up this arrow.

getPickupMode() ​

php
public function getPickupMode() : int

getPierceLevel() 5.46.0 ​

php
public function getPierceLevel() : int

getPotionType() 5.46.0 ​

php
public function getPotionType() : ?\pocketmine\item\PotionType

Returns the potion of a tipped arrow, or null for a normal arrow.

getPunchKnockback() ​

php
public function getPunchKnockback() : float

getResultDamage() ​

php
public function getResultDamage() : int

initEntity() protected ​

php
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : void

isCritical() ​

php
public function isCritical() : bool

onCollideWithPlayer() ​

php
public function onCollideWithPlayer(\pocketmine\player\Player $player) : void

onHit() protected ​

php
protected function onHit(\pocketmine\event\entity\ProjectileHitEvent $event) : void

onHitBlock() protected ​

php
protected function onHitBlock(\pocketmine\block\Block $blockHit, \pocketmine\math\RayTraceResult $hitResult) : void

onHitEntity() protected ​

php
protected function onHitEntity(\pocketmine\entity\Entity $entityHit, \pocketmine\math\RayTraceResult $hitResult) : void

saveNBT() ​

php
public function saveNBT() : \pocketmine\nbt\tag\CompoundTag

setCritical() ​

php
public function setCritical(bool $value = true) : void

setPickupMode() ​

php
public function setPickupMode(int $pickupMode) : void

setPierceLevel() 5.46.0 ​

php
public function setPierceLevel(int $level) : void

Sets the Piercing level (crossbows): the arrow passes through that many mobs, hitting each once.

setPotionType() 5.46.0 ​

php
public function setPotionType(?\pocketmine\item\PotionType $potionType) : void

Sets the potion of a tipped arrow (null for a normal arrow). Its effects are applied to the mob hit, with 1/8 of the potion's duration (see TippedArrow::getArrowEffects()).

setPunchKnockback() ​

php
public function setPunchKnockback(float $punchKnockback) : void

syncNetworkData() protected ​

php
protected function syncNetworkData(\pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection $properties) : void

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