Skip to content

CrafterInventory 5.46.0 ​

class · pocketmine\block\inventory\CrafterInventory · source

Extends SimpleInventory
Implements BlockInventory

The 3x3 crafting grid of a crafter. Slot 0 is the top left corner, slots go row by row.

Disabled slots never hold items. They are stored as a bit mask, bit N for slot N (the Bedrock "disabled_slots" block entity tag; same layout as GeyserMC CrafterContainer.disabledSlotsMask).

Constants ​

ALL_SLOTS_MASK ​

php
public const ALL_SLOTS_MASK = (1 << self::SIZE) - 1

SIZE ​

php
public const SIZE = 9

Methods ​

__construct() ​

php
public function __construct(\pocketmine\world\Position $holder)

getDisabledSlotsMask() ​

php
public function getDisabledSlotsMask() : int

isSlotDisabled() ​

php
public function isSlotDisabled(int $slot) : bool

setDisabledSlotsMask() ​

php
public function setDisabledSlotsMask(int $mask) : void

setSlotDisabled() ​

php
public function setSlotDisabled(int $slot, bool $disabled) : bool

Disables or enables a slot. Only empty slots can be disabled; returns false if the slot could not be changed.

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.