BedrioxDOCUMENTATION
API CLASS

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(): int

Typed public method.

getSelectedHotbarSlot(): int

Typed public method.

getHeldItem(): ?Bedriox\Api\Inventory\ItemStack

Typed public method.

getItem(int $slot): ?Bedriox\Api\Inventory\ItemStack

Typed public method.

getContents(): array

Typed public method.

isEmpty(): bool

Typed public method.

contains(Bedriox\Api\Inventory\ItemStack $stack): bool

Typed public method.

getAddableQuantity(Bedriox\Api\Inventory\ItemStack $stack): int

Typed public method.

firstEmpty(): ?int

Typed public method.

setItem(int $slot, ?Bedriox\Api\Inventory\ItemStack $stack): void

Typed public method.

setContents(array $contents): void

Typed public method.

addItem(Bedriox\Api\Inventory\ItemStack $stack): void

Typed public method.

removeItem(Bedriox\Api\Inventory\ItemStack $stack): void

Typed public method.

clear(int $slot): void

Typed public method.

clearAll(): void

Typed public method.

setSelectedHotbarSlot(int $slot): void

Typed public method.

View exact source ↗