PocketMine-MP 5.42.1 git-d77520d210fcb967a02bc11817ad625393c8ebc6
Loading...
Searching...
No Matches
pocketmine\inventory\transaction\action\DestroyItemAction Class Reference
+ Inheritance diagram for pocketmine\inventory\transaction\action\DestroyItemAction:
+ Collaboration diagram for pocketmine\inventory\transaction\action\DestroyItemAction:

Public Member Functions

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

Detailed Description

This action type shows up when a creative player puts an item into the creative inventory menu to destroy it. The output is the item destroyed. You can think of this action type like setting an item into /dev/null

Definition at line 35 of file DestroyItemAction.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 37 of file DestroyItemAction.php.

Member Function Documentation

◆ execute()

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

Performs actions needed to complete the inventory-action server-side. This will only be called if the transaction which it is part of is considered valid.

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

Definition at line 47 of file DestroyItemAction.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.

Deprecated

Definition at line 65 of file InventoryAction.php.

◆ onPreExecute()

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

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

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

Definition at line 73 of file InventoryAction.php.

◆ validate()

pocketmine\inventory\transaction\action\DestroyItemAction::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 DestroyItemAction.php.


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