*/ class EntityItemPickupEvent extends EntityEvent implements Cancellable{ use CancellableTrait; public function __construct( Entity $collector, private Entity $origin, private Item $item, private ?Inventory $inventory ){ $this->entity = $collector; } public function getOrigin() : Entity{ return $this->origin; } /** * Items to be received */ public function getItem() : Item{ return clone $this->item; } /** * Change the items to receive. */ public function setItem(Item $item) : void{ $this->item = clone $item; } /** * Inventory to which received items will be added. */ public function getInventory() : ?Inventory{ return $this->inventory; } /** * Change the inventory to which received items are added. */ public function setInventory(?Inventory $inventory) : void{ $this->inventory = $inventory; } }