Dispenser 5.46.0
Extends Spawnable
Implements ComparatorReadableContainer, Nameable
Block entity of dispensers ("Dispenser") and, through Dropper, droppers.
Properties
$inventory protected
php
protected \pocketmine\block\inventory\DispenserInventory $inventoryMethods
__construct()
php
public function __construct(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pos)close()
php
public function close() : voidcreateInventory() protected
php
protected function createInventory() : \pocketmine\block\inventory\DispenserInventorygetDefaultName()
php
public function getDefaultName() : stringgetInventory()
php
public function getInventory() : \pocketmine\block\inventory\DispenserInventoryReturns the inventory, filling it from its loot table first if it has one (see LootTableContainerTrait).
getPendingDispenseTick()
php
public function getPendingDispenseTick() : intServer tick at which the block should dispense (set when it gets powered), or -1 if no dispense is pending. Block updates are also scheduled for other reasons (e.g. when the tile is added to the world as its chunk loads), so the block only dispenses when one was requested.
getRealInventory()
php
public function getRealInventory() : \pocketmine\block\inventory\DispenserInventoryonBlockDestroyedHook() protected
php
protected function onBlockDestroyedHook() : voidreadSaveData()
php
public function readSaveData(\pocketmine\nbt\tag\CompoundTag $nbt) : voidsetPendingDispenseTick()
php
public function setPendingDispenseTick(int $tick) : voidwriteSaveData() protected
php
protected function writeSaveData(\pocketmine\nbt\tag\CompoundTag $nbt) : void