DispenseContext 5.46.0
A dispenser (or dropper, or crafter) about to dispense an item.
Methods
__construct()
php
public function __construct(\pocketmine\world\World $world, \pocketmine\math\Vector3 $position, int $facing, \pocketmine\inventory\Inventory $inventory)addOrDrop()
php
public function addOrDrop(\pocketmine\item\Item $item) : voidPuts an item produced while dispensing back into the dispenser, or drops it in front if it doesn't fit.
getDispensePosition()
php
public function getDispensePosition() : \pocketmine\math\Vector3Point items and projectiles come out of: 0.7 blocks from the centre of the dispenser, towards its front.
getFacing()
php
public function getFacing() : intDirection the dispenser faces.
getInventory()
php
public function getInventory() : \pocketmine\inventory\InventorygetPosition()
php
public function getPosition() : \pocketmine\math\Vector3Position of the dispensing block.
getTargetBlock()
php
public function getTargetBlock() : \pocketmine\block\BlockgetTargetPosition()
php
public function getTargetPosition() : \pocketmine\math\Vector3Position of the block in front of the dispenser.
getWorld()
php
public function getWorld() : \pocketmine\world\WorldnextGaussian()
php
public static function nextGaussian() : floatNormally distributed random number (mean 0, standard deviation 1).
playEffects()
php
public function playEffects(?\pocketmine\world\sound\Sound $sound = null) : voidPlays the sound and smoke puff of a successful dispense.
