DispenseBehaviorRegistry 5.46.0
Chooses what a dispenser does with each item. Items without a registered behaviour are dropped.
Behaviours follow the Minecraft Wiki "Dispenser" page (Bedrock): projectiles are shot, liquids and blocks are placed, tools are used on the block in front, armor is equipped on a mob or player in front. Items whose entities or targets don't exist on this server (saddles, sheep shearing...) are dropped or do nothing. Minecarts are put on the rail in front (or below the block in front), boats on the water in front.
Methods
__construct()
php
public function __construct()get()
php
public function get(\pocketmine\item\Item $item) : \pocketmine\block\dispenser\DispenseBehaviorgetDefault()
php
public function getDefault() : \pocketmine\block\dispenser\DispenseBehaviorregister()
php
public function register(int $itemTypeId, \pocketmine\block\dispenser\DispenseBehavior $behavior) : voidSets the behaviour of an item type, replacing any previous one.
