Crossbow 5.46.0
Extends Tool
Implements Chargeable
Methods
canStartUsingItem()
php
public function canStartUsingItem(\pocketmine\player\Player $player) : boolcontinueUsing()
php
public function continueUsing(\pocketmine\player\Player $player, int $useDuration) : voidOnly 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) : voidgetChargeDuration()
php
public function getChargeDuration() : intgetFuelTime()
php
public function getFuelTime() : intgetMaxDurability()
php
public function getMaxDurability() : intisCharged()
php
public function isCharged() : boolonChargeComplete()
php
public function onChargeComplete(\pocketmine\player\Player $player, int $useDuration) : boolonClickAir()
php
public function onClickAir(\pocketmine\player\Player $player, \pocketmine\math\Vector3 $directionVector, array &$returnedItems) : \pocketmine\item\ItemUseResultserializeCompoundTag() protected
php
protected function serializeCompoundTag(\pocketmine\nbt\tag\CompoundTag $tag) : voidsetCharged()
php
public function setCharged(?\pocketmine\item\Item $item) : void