Documentation

CreateItemAction extends InventoryAction
in package

This action is used by creative players to balance transactions involving the creative inventory menu.

The source item is the item being created ("taken" from the creative menu).

Table of Contents

$sourceItem  : Item
$targetItem  : Item
__construct()  : mixed
execute()  : void
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.
getSourceItem()  : Item
Returns the item that was present before the action took place.
getTargetItem()  : Item
Returns the item that the action attempted to replace the source item with.
onAddToTransaction()  : void
Called when the action is added to the specified InventoryTransaction.
onPreExecute()  : bool
Called by inventory transactions before any actions are processed. If this returns false, the transaction will be cancelled.
validate()  : void
Returns whether this action is currently valid. This should perform any necessary sanity checks.

Properties

Methods

__construct()

public __construct(Item $sourceItem) : mixed
Parameters
$sourceItem : Item
Return values
mixed

execute()

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.

public execute(Player $source) : void
Parameters
$source : Player
Return values
void

getSourceItem()

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

public getSourceItem() : Item
Return values
Item

getTargetItem()

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

public getTargetItem() : Item
Return values
Item

onPreExecute()

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

public onPreExecute(Player $source) : bool
Parameters
$source : Player
Return values
bool

validate()

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

public validate(Player $source) : void
Parameters
$source : Player
Return values
void

Search results