DispenseBehavior 5.46.0
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\ItemDispenses 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().
