CraftItemEvent
extends Event
in package
implements
Cancellable
Uses
CancellableTrait
Interfaces, Classes, Traits and Enums
- Cancellable
- This interface is implemented by an Event subclass if and only if it can be cancelled.
Table of Contents
- MAX_EVENT_CALL_DEPTH = 50
- $eventName : string|null
- $eventCallDepth : int
- $inputs : array<string|int, Item>
- $isCancelled : bool
- $outputs : array<string|int, Item>
- $recipe : CraftingRecipe
- $repetitions : int
- $transaction : CraftingTransaction
- __construct() : mixed
- call() : void
- Calls event handlers registered for this event.
- cancel() : void
- getEventName() : string
- getInputs() : array<string|int, Item>
- Returns a list of items destroyed as ingredients of the recipe.
- getOutputs() : array<string|int, Item>
- Returns a list of items created by crafting the recipe.
- getPlayer() : Player
- getRecipe() : CraftingRecipe
- Returns the recipe crafted.
- getRepetitions() : int
- Returns the number of times the recipe was crafted. This is usually 1, but might be more in the case of recipe book shift-clicks (which craft lots of items in a batch).
- getTransaction() : CraftingTransaction
- Returns the inventory transaction involved in this crafting event.
- isCancelled() : bool
- uncancel() : void
Constants
MAX_EVENT_CALL_DEPTH
private
mixed
MAX_EVENT_CALL_DEPTH
= 50
Properties
$eventName
protected
string|null
$eventName
= null
$eventCallDepth
private
static int
$eventCallDepth
= 1
$inputs
private
array<string|int, Item>
$inputs
$isCancelled
private
bool
$isCancelled
= false
$outputs
private
array<string|int, Item>
$outputs
$recipe
private
CraftingRecipe
$recipe
$repetitions
private
int
$repetitions
$transaction
private
CraftingTransaction
$transaction
Methods
__construct()
public
__construct(CraftingTransaction $transaction, CraftingRecipe $recipe, int $repetitions, array<string|int, Item> $inputs, array<string|int, Item> $outputs) : mixed
Parameters
- $transaction : CraftingTransaction
- $recipe : CraftingRecipe
- $repetitions : int
- $inputs : array<string|int, Item>
- $outputs : array<string|int, Item>
Return values
mixed —call()
Calls event handlers registered for this event.
public
call() : void
Tags
Return values
void —cancel()
public
cancel() : void
Return values
void —getEventName()
public
final getEventName() : string
Return values
string —getInputs()
Returns a list of items destroyed as ingredients of the recipe.
public
getInputs() : array<string|int, Item>
Return values
array<string|int, Item> —getOutputs()
Returns a list of items created by crafting the recipe.
public
getOutputs() : array<string|int, Item>
Return values
array<string|int, Item> —getPlayer()
public
getPlayer() : Player
Return values
Player —getRecipe()
Returns the recipe crafted.
public
getRecipe() : CraftingRecipe
Return values
CraftingRecipe —getRepetitions()
Returns the number of times the recipe was crafted. This is usually 1, but might be more in the case of recipe book shift-clicks (which craft lots of items in a batch).
public
getRepetitions() : int
Return values
int —getTransaction()
Returns the inventory transaction involved in this crafting event.
public
getTransaction() : CraftingTransaction
Return values
CraftingTransaction —isCancelled()
public
isCancelled() : bool
Return values
bool —uncancel()
public
uncancel() : void