Skip to content

DispenseBehavior 5.46.0 ​

interface · pocketmine\block\dispenser\DispenseBehavior · source

What a dispenser does with an item type.

Methods ​

dispense() ​

php
public function dispense(\pocketmine\block\dispenser\DispenseContext $context, \pocketmine\item\Item $stack) : ?\pocketmine\item\Item

Dispenses from the given stack, which is a copy of the contents of the chosen dispenser slot. Returns the new contents of the slot, or null if nothing could be done (the item stays and the dispenser clicks as if empty). Items produced on the side (e.g. a filled bucket from a stack of empty buckets) go through DispenseContext::addOrDrop().

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