Skip to content

Shelf 5.46.0 ​

class · pocketmine\block\tile\Shelf · source

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 = 3

Methods ​

__construct() ​

php
public function __construct(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pos)

addAdditionalSpawnData() protected ​

php
protected function addAdditionalSpawnData(\pocketmine\nbt\tag\CompoundTag $nbt) : void

getInventory() ​

php
public function getInventory() : \pocketmine\inventory\SimpleInventory

getRealInventory() ​

php
public function getRealInventory() : \pocketmine\inventory\SimpleInventory

loadItems() protected ​

php
protected function loadItems(\pocketmine\nbt\tag\CompoundTag $tag) : void

readSaveData() ​

php
public function readSaveData(\pocketmine\nbt\tag\CompoundTag $nbt) : void

saveItems() protected ​

php
protected function saveItems(\pocketmine\nbt\tag\CompoundTag $tag) : void

writeSaveData() protected ​

php
protected function writeSaveData(\pocketmine\nbt\tag\CompoundTag $nbt) : void

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