BedrioxDOCUMENTATION
API CLASS

Container

Live protocol-neutral handle for one authoritative container.

Bedriox\Api\Inventory\Container
classBedriox\Api\Inventory

Public methods

__construct(Closure $view, Closure $setItem, Closure $addItem, Closure $removeItem, Closure $clear, Closure $open, Closure $close, ?Closure $guard = null)

Typed public method.

isAvailable(): bool

Typed public method.

view(): ?Bedriox\Api\Inventory\ContainerView

Typed public method.

type(): ?Bedriox\Api\Inventory\ContainerType

Typed public method.

position(): ?Bedriox\Api\World\BlockPosition

Typed public method.

contents(): array

Typed public method.

viewerUuids(): array

Typed public method.

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

Typed public method.

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

Adds as much as possible and returns the unaccepted remainder, if any.

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

Removes up to the requested count and returns the number actually removed.

clear(): bool

Typed public method.

open(Bedriox\Api\Player\Player $player): bool

Typed public method.

close(Bedriox\Api\Player\Player $player): bool

Typed public method.

View exact source ↗