Skip to content

Dispenser 5.46.0 ​

class · pocketmine\block\tile\Dispenser · source

Extends Spawnable
Implements ComparatorReadableContainer, Nameable

Block entity of dispensers ("Dispenser") and, through Dropper, droppers.

Properties ​

$inventory protected ​

php
protected \pocketmine\block\inventory\DispenserInventory $inventory

Methods ​

__construct() ​

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

close() ​

php
public function close() : void

createInventory() protected ​

php
protected function createInventory() : \pocketmine\block\inventory\DispenserInventory

getDefaultName() ​

php
public function getDefaultName() : string

getInventory() ​

php
public function getInventory() : \pocketmine\block\inventory\DispenserInventory

Returns the inventory, filling it from its loot table first if it has one (see LootTableContainerTrait).

getPendingDispenseTick() ​

php
public function getPendingDispenseTick() : int

Server 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\DispenserInventory

onBlockDestroyedHook() protected ​

php
protected function onBlockDestroyedHook() : void

readSaveData() ​

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

setPendingDispenseTick() ​

php
public function setPendingDispenseTick(int $tick) : 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.