PocketMine-MP 5.15.1 git-be6754494fdbbb9dd57c058ba0e33a4a78c4581f
pocketmine\inventory\transaction\action\DropItemAction Class Reference
+ Inheritance diagram for pocketmine\inventory\transaction\action\DropItemAction:
+ Collaboration diagram for pocketmine\inventory\transaction\action\DropItemAction:

Public Member Functions

 __construct (Item $targetItem)
 
 execute (Player $source)
 
 getSourceItem ()
 
 getTargetItem ()
 
 onAddToTransaction (InventoryTransaction $transaction)
 
 onPreExecute (Player $source)
 
 validate (Player $source)
 

Detailed Description

Represents an action involving dropping an item into the world.

Definition at line 35 of file DropItemAction.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\inventory\transaction\action\DropItemAction::__construct ( Item  $targetItem)

Definition at line 37 of file DropItemAction.php.

Member Function Documentation

◆ execute()

pocketmine\inventory\transaction\action\DropItemAction::execute ( Player  $source)

Drops the target item in front of the player.

Reimplemented from pocketmine\inventory\transaction\action\InventoryAction.

Definition at line 66 of file DropItemAction.php.

◆ getSourceItem()

pocketmine\inventory\transaction\action\InventoryAction::getSourceItem ( )
inherited

Returns the item that was present before the action took place.

Definition at line 43 of file InventoryAction.php.

◆ getTargetItem()

pocketmine\inventory\transaction\action\InventoryAction::getTargetItem ( )
inherited

Returns the item that the action attempted to replace the source item with.

Definition at line 50 of file InventoryAction.php.

◆ onAddToTransaction()

pocketmine\inventory\transaction\action\InventoryAction::onAddToTransaction ( InventoryTransaction  $transaction)
inherited

Called when the action is added to the specified InventoryTransaction.

Reimplemented in pocketmine\inventory\transaction\action\SlotChangeAction.

Definition at line 64 of file InventoryAction.php.

◆ onPreExecute()

pocketmine\inventory\transaction\action\DropItemAction::onPreExecute ( Player  $source)

Called by inventory transactions before any actions are processed. If this returns false, the transaction will be cancelled.

Reimplemented from pocketmine\inventory\transaction\action\InventoryAction.

Definition at line 50 of file DropItemAction.php.

◆ validate()

pocketmine\inventory\transaction\action\DropItemAction::validate ( Player  $source)

Returns whether this action is currently valid. This should perform any necessary sanity checks.

Exceptions
TransactionValidationException

Reimplemented from pocketmine\inventory\transaction\action\InventoryAction.

Definition at line 41 of file DropItemAction.php.


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