Shelf 5.46.0
Extends Spawnable
Implements Container
Block entity of the wooden shelves (Bedrock ID "Shelf"). Holds three item stacks that the client renders on the front of the shelf. Unlike other containers, the position of an entry in the Items list (not a Slot tag) determines which slot it occupies, so empty slots are written as empty item entries.
Constants
SLOTS
php
public const SLOTS = 3Methods
__construct()
php
public function __construct(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pos)addAdditionalSpawnData() protected
php
protected function addAdditionalSpawnData(\pocketmine\nbt\tag\CompoundTag $nbt) : voidgetInventory()
php
public function getInventory() : \pocketmine\inventory\SimpleInventorygetRealInventory()
php
public function getRealInventory() : \pocketmine\inventory\SimpleInventoryloadItems() protected
php
protected function loadItems(\pocketmine\nbt\tag\CompoundTag $tag) : voidreadSaveData()
php
public function readSaveData(\pocketmine\nbt\tag\CompoundTag $nbt) : voidsaveItems() protected
php
protected function saveItems(\pocketmine\nbt\tag\CompoundTag $tag) : voidwriteSaveData() protected
php
protected function writeSaveData(\pocketmine\nbt\tag\CompoundTag $nbt) : void