Skip to content

EntityItemPickupEvent ​

class · pocketmine\event\entity\EntityItemPickupEvent · source

Extends EntityEvent
Implements Cancellable

Called when an entity picks up an item, arrow, etc.

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\Entity $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.