PlayerInventory
Immutable main-inventory snapshot with session-bound authoritative mutations.
Bedriox\Api\Inventory\PlayerInventory
classBedriox\Api\Inventory
Public methods
__construct(Bedriox\Api\Inventory\Inventory $snapshot, Bedriox\Api\Inventory\PlayerInventoryActions $actions, ?Closure $maximumStackSize = null)Typed public method.
getSize(): intTyped public method.
getSelectedHotbarSlot(): intTyped public method.
getHeldItem(): ?Bedriox\Api\Inventory\ItemStackTyped public method.
getItem(int $slot): ?Bedriox\Api\Inventory\ItemStackTyped public method.
getContents(): arrayTyped public method.
isEmpty(): boolTyped public method.
contains(Bedriox\Api\Inventory\ItemStack $stack): boolTyped public method.
getAddableQuantity(Bedriox\Api\Inventory\ItemStack $stack): intTyped public method.
firstEmpty(): ?intTyped public method.
setItem(int $slot, ?Bedriox\Api\Inventory\ItemStack $stack): voidTyped public method.
setContents(array $contents): voidTyped public method.
addItem(Bedriox\Api\Inventory\ItemStack $stack): voidTyped public method.
removeItem(Bedriox\Api\Inventory\ItemStack $stack): voidTyped public method.
clear(int $slot): voidTyped public method.
clearAll(): voidTyped public method.
setSelectedHotbarSlot(int $slot): voidTyped public method.
