PocketMine-MP 5.21.2 git-a6534ecbbbcf369264567d27e5ed70f7f5be9816
Loading...
Searching...
No Matches
pocketmine\event\block\BlockItemPickupEvent Class Reference
+ Inheritance diagram for pocketmine\event\block\BlockItemPickupEvent:
+ Collaboration diagram for pocketmine\event\block\BlockItemPickupEvent:

Public Member Functions

 __construct (Block $collector, private Entity $origin, private Item $item, private ?Inventory $inventory)
 
 call ()
 
 getBlock ()
 
 getEventName ()
 
 getInventory ()
 
 getItem ()
 
 getOrigin ()
 
 isCancelled ()
 
 setInventory (?Inventory $inventory)
 
 setItem (Item $item)
 

Static Public Member Functions

static hasHandlers ()
 

Protected Attributes

string $eventName = null
 

Detailed Description

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

Definition at line 36 of file BlockItemPickupEvent.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\event\block\BlockItemPickupEvent::__construct ( Block $collector,
private Entity $origin,
private Item $item,
private ?Inventory $inventory )

Definition at line 39 of file BlockItemPickupEvent.php.

Member Function Documentation

◆ call()

pocketmine\event\Event::call ( )
inherited

Calls event handlers registered for this event.

Exceptions

RuntimeException if event call recursion reaches the max depth limit

Definition at line 49 of file Event.php.

◆ getBlock()

pocketmine\event\block\BlockEvent::getBlock ( )
inherited

Definition at line 37 of file BlockEvent.php.

◆ getEventName()

pocketmine\event\Event::getEventName ( )
finalinherited

Definition at line 40 of file Event.php.

◆ getInventory()

pocketmine\event\block\BlockItemPickupEvent::getInventory ( )

Inventory to which received items will be added.

Definition at line 69 of file BlockItemPickupEvent.php.

◆ getItem()

pocketmine\event\block\BlockItemPickupEvent::getItem ( )

Items to be received

Definition at line 55 of file BlockItemPickupEvent.php.

◆ getOrigin()

pocketmine\event\block\BlockItemPickupEvent::getOrigin ( )

Definition at line 48 of file BlockItemPickupEvent.php.

◆ hasHandlers()

static pocketmine\event\Event::hasHandlers ( )
staticinherited

Returns whether the current class context has any registered global handlers. This can be used in hot code paths to avoid unnecessary event object creation.

Usage: SomeEventClass::hasHandlers()

Definition at line 77 of file Event.php.

◆ isCancelled()

pocketmine\event\Cancellable::isCancelled ( )
inherited

Returns whether this instance of the event is currently cancelled.

If it is cancelled, only downstream handlers that declare @handleCancelled will be called with this event.

◆ setInventory()

pocketmine\event\block\BlockItemPickupEvent::setInventory ( ?Inventory $inventory)

Change the inventory to which received items are added.

Definition at line 76 of file BlockItemPickupEvent.php.

◆ setItem()

pocketmine\event\block\BlockItemPickupEvent::setItem ( Item $item)

Change the items to receive.

Definition at line 62 of file BlockItemPickupEvent.php.

Member Data Documentation

◆ $eventName

string pocketmine\event\Event::$eventName = null
protectedinherited

Definition at line 38 of file Event.php.


The documentation for this class was generated from the following file: