Chargeable 5.46.0
Extends Releasable
Interface implemented by objects that can be charged.
Flow (same as vanilla): the first use starts charging; while charging, the client sends another use when its own charge bar is full, which calls onChargeComplete(); releasing before that cancels; once charged, the next use fires (onClickAir()).
Methods
getChargeDuration()
php
public function getChargeDuration() : intReturns an amount of ticks that this item should be in charge.
isCharged()
php
public function isCharged() : boolonChargeComplete()
php
public function onChargeComplete(\pocketmine\player\Player $player, int $useDuration) : boolCalled when the client reports that charging finished. Returns whether the item is now charged.
setCharged()
php
public function setCharged(?\pocketmine\item\Item $item) : void