Skip to content

Crossbow 5.46.0 ​

class · pocketmine\item\Crossbow · source

Extends Tool
Implements Chargeable

Methods ​

canStartUsingItem() ​

php
public function canStartUsingItem(\pocketmine\player\Player $player) : bool

continueUsing() ​

php
public function continueUsing(\pocketmine\player\Player $player, int $useDuration) : void

Only plays the loading sounds. The crossbow is loaded in onChargeComplete(), when the client reports that its charge finished: loading it here on the server's own clock replaced the held item, which reset the "using item" state, so the client's charge-complete signal arrived as a fresh use and fired the crossbow.

deserializeCompoundTag() protected ​

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

getChargeDuration() ​

php
public function getChargeDuration() : int

getFuelTime() ​

php
public function getFuelTime() : int

getMaxDurability() ​

php
public function getMaxDurability() : int

isCharged() ​

php
public function isCharged() : bool

onChargeComplete() ​

php
public function onChargeComplete(\pocketmine\player\Player $player, int $useDuration) : bool

onClickAir() ​

php
public function onClickAir(\pocketmine\player\Player $player, \pocketmine\math\Vector3 $directionVector, array &$returnedItems) : \pocketmine\item\ItemUseResult

serializeCompoundTag() protected ​

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

setCharged() ​

php
public function setCharged(?\pocketmine\item\Item $item) : void

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