Skip to content

ChiseledBookshelf ​

class · pocketmine\block\ChiseledBookshelf · source

Extends Opaque
Implements HorizontalFacing

Methods ​

describeBlockOnlyState() protected ​

php
protected function describeBlockOnlyState(\pocketmine\data\runtime\RuntimeDataDescriber $w) : void

getDropsForCompatibleTool() ​

php
public function getDropsForCompatibleTool(\pocketmine\item\Item $item) : array

getLastInteractedSlot() ​

php
public function getLastInteractedSlot() : ?\pocketmine\block\utils\ChiseledBookshelfSlot

Returns the last slot interacted by a player or null if no slot has been interacted with yet.

getSlots() ​

php
public function getSlots() : array

Returns which slots of the bookshelf are displayed as occupied. As above, these values do not necessarily reflect the contents of the bookshelf inventory, although they usually will unless modified by plugins.

hasSlot() ​

php
public function hasSlot(\pocketmine\block\utils\ChiseledBookshelfSlot $slot) : bool

Returns whether the given slot is displayed as occupied. This doesn't guarantee that there is or isn't a book in the bookshelf's inventory.

isAffectedBySilkTouch() ​

php
public function isAffectedBySilkTouch() : bool

onInteract() ​

php
public function onInteract(\pocketmine\item\Item $item, int $face, \pocketmine\math\Vector3 $clickVector, ?\pocketmine\player\Player $player = null, array &$returnedItems = []) : bool

readStateFromWorld() ​

php
public function readStateFromWorld() : \pocketmine\block\Block

setLastInteractedSlot() ​

php
public function setLastInteractedSlot(?\pocketmine\block\utils\ChiseledBookshelfSlot $lastInteractedSlot) : self

Sets the last slot interacted by a player.

setSlot() ​

php
public function setSlot(\pocketmine\block\utils\ChiseledBookshelfSlot $slot, bool $occupied) : self

Sets whether the given slot is displayed as occupied.

This doesn't modify the bookshelf's inventory, so you can use this to make invisible books or display books that aren't actually in the bookshelf.

To modify the contents of the bookshelf inventory, access the tile inventory.

setSlots() ​

php
public function setSlots(array $slots) : self

writeStateToWorld() ​

php
public function writeStateToWorld() : void

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