Skip to content

BlockItemPickupEvent ​

class · pocketmine\event\block\BlockItemPickupEvent · source

Extends BlockEvent
Implements Cancellable

Called when a block picks up an item, arrow, etc.

Methods ​

__construct() ​

php
public function __construct(\pocketmine\block\Block $collector, \pocketmine\entity\Entity $origin, \pocketmine\item\Item $item, ?\pocketmine\inventory\Inventory $inventory)

getInventory() ​

php
public function getInventory() : ?\pocketmine\inventory\Inventory

Inventory to which received items will be added.

getItem() ​

php
public function getItem() : \pocketmine\item\Item

Items to be received

getOrigin() ​

php
public function getOrigin() : \pocketmine\entity\Entity

setInventory() ​

php
public function setInventory(?\pocketmine\inventory\Inventory $inventory) : void

Change the inventory to which received items are added.

setItem() ​

php
public function setItem(\pocketmine\item\Item $item) : void

Change the items to receive.

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