Crafter 5.46.0
Extends Spawnable
Implements ComparatorReadableContainer, Nameable
Block entity of crafters ("Crafter").
Saved data: Items (slots 0-8) and disabled_slots (TAG_Short bit mask, bit N = slot N), per the Minecraft Wiki "Bedrock Edition level format/Block entity format" and GeyserMC CrafterInventoryTranslator.
Constants
TAG_DISABLED_SLOTS
php
public const TAG_DISABLED_SLOTS = "disabled_slots"Properties
$inventory protected
php
protected \pocketmine\block\inventory\CrafterInventory $inventoryMethods
__construct()
php
public function __construct(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pos)addAdditionalSpawnData() protected
php
protected function addAdditionalSpawnData(\pocketmine\nbt\tag\CompoundTag $nbt) : voidclose()
php
public function close() : voidgetComparatorOutput()
php
public function getComparatorOutput() : intVanilla: the number of slots which are disabled or hold an item, whatever the stack sizes.
getCraftAtTick()
php
public function getCraftAtTick() : ?intgetCraftingUntilTick()
php
public function getCraftingUntilTick() : intgetDefaultName()
php
public function getDefaultName() : stringgetInsertSlotFor()
php
public function getInsertSlotFor(\pocketmine\item\Item $item) : ?intReturns the slot a hopper or dropper puts the given item into, or null if no enabled slot can take it. Vanilla: the first empty enabled slot, otherwise the matching stack with the lowest count (earliest on ties).
getInventory()
php
public function getInventory() : \pocketmine\block\inventory\CrafterInventorygetRealInventory()
php
public function getRealInventory() : \pocketmine\block\inventory\CrafterInventoryreadSaveData()
php
public function readSaveData(\pocketmine\nbt\tag\CompoundTag $nbt) : voidsetCraftAtTick()
php
public function setCraftAtTick(?int $tick) : voidsetCraftingUntilTick()
php
public function setCraftingUntilTick(int $tick) : voidsetSlotDisabled()
php
public function setSlotDisabled(int $slot, bool $disabled) : boolToggles a slot and tells clients and comparators. Returns false if the slot could not be changed (it holds an item).
writeSaveData() protected
php
protected function writeSaveData(\pocketmine\nbt\tag\CompoundTag $nbt) : void