PlayerInventory
Extends SimpleInventory
Properties
$heldItemIndexChangeListeners protected
php
protected \pocketmine\utils\ObjectSet $heldItemIndexChangeListeners$holder protected
php
protected \pocketmine\entity\Human $holder$itemInHandIndex protected
php
protected int $itemInHandIndexMethods
__construct()
php
public function __construct(\pocketmine\entity\Human $player)getHeldItemIndex()
php
public function getHeldItemIndex() : intReturns the hotbar slot number the holder is currently holding.
getHeldItemIndexChangeListeners()
php
public function getHeldItemIndexChangeListeners() : \pocketmine\utils\ObjectSetgetHolder()
php
public function getHolder() : \pocketmine\entity\HumangetHotbarSize()
php
public function getHotbarSize() : intReturns the number of slots in the hotbar.
getHotbarSlotItem()
php
public function getHotbarSlotItem(int $hotbarSlot) : \pocketmine\item\ItemReturns the item in the specified hotbar slot.
getItemInHand()
php
public function getItemInHand() : \pocketmine\item\ItemReturns the currently-held item.
isHotbarSlot()
php
public function isHotbarSlot(int $slot) : boolsetHeldItemIndex()
php
public function setHeldItemIndex(int $hotbarSlot) : voidSets which hotbar slot the player is currently loading.
setItemInHand()
php
public function setItemInHand(\pocketmine\item\Item $item) : voidSets the item in the currently-held slot to the specified item.
