SlotChangeAction
Extends InventoryAction
Represents an action causing a change in an inventory slot.
Properties
$inventory
php
public \pocketmine\inventory\Inventory $inventoryMethods
__construct()
php
public function __construct(\pocketmine\inventory\Inventory $inventory, int $inventorySlot, \pocketmine\item\Item $sourceItem, \pocketmine\item\Item $targetItem)execute()
php
public function execute(\pocketmine\player\Player $source) : voidSets the item into the target inventory.
getInventory()
php
public function getInventory() : \pocketmine\inventory\InventoryReturns the inventory involved in this action.
getSlot()
php
public function getSlot() : intReturns the slot in the inventory which this action modified.
validate()
php
public function validate(\pocketmine\player\Player $source) : voidChecks if the item in the inventory at the specified slot is the same as this action's source item.
