Documentation

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

Methods

call()

Calls event handlers registered for this event.

public call() : void
Tags
throws
RuntimeException

if event call recursion reaches the max depth limit

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>

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

Search results