Shelf 5.46.0
Extends Transparent
Implements HorizontalFacing, PoweredByRedstone
Wooden shelf (Bedrock 1.21.110+). Displays up to three item stacks on its front.
Unpowered: using the front face swaps the held item with the clicked slot (in creative the held item is copied into the slot instead, unless the hand is empty). Powered: the shelf joins adjacent powered shelves facing the same way into chains of up to three (filled from the left as seen from the front), and using any shelf of a chain swaps the whole chain with the rightmost 3, 6 or 9 hotbar slots.
PocketMine has no redstone propagation, so the powered state only changes when set by a plugin or loaded from a world; the chain shape (powered_shelf_type) is recalculated from the neighbouring shelves.
Constants
MAX_CHAIN_LENGTH
public const MAX_CHAIN_LENGTH = 3Properties
$chainPart protected
protected \pocketmine\block\utils\ShelfChainPart $chainPartMethods
describeBlockOnlyState() protected
protected function describeBlockOnlyState(\pocketmine\data\runtime\RuntimeDataDescriber $w) : voidgetChain()
public function getChain() : arrayReturns the powered shelves of this shelf's chain, ordered from left to right (as seen from the front). Rows of adjacent powered shelves are split into chains of three starting from the left.
getChainPart()
public function getChainPart() : \pocketmine\block\utils\ShelfChainPartgetFlameEncouragement()
public function getFlameEncouragement() : intgetFlammability()
public function getFlammability() : intisAffectedBySilkTouch()
public function isAffectedBySilkTouch() : boolonInteract()
public function onInteract(\pocketmine\item\Item $item, int $face, \pocketmine\math\Vector3 $clickVector, ?\pocketmine\player\Player $player = null, array &$returnedItems = []) : boolonNearbyBlockChange()
public function onNearbyBlockChange() : voidsetChainPart()
public function setChainPart(\pocketmine\block\utils\ShelfChainPart $chainPart) : selfSets the displayed chain shape. This is normally recalculated automatically from the neighbouring shelves.
