Skip to content

CraftItemEvent ​

class · pocketmine\event\inventory\CraftItemEvent · source

Extends Event
Implements Cancellable

Methods ​

__construct() ​

php
public function __construct(\pocketmine\inventory\transaction\CraftingTransaction $transaction, \pocketmine\crafting\CraftingRecipe $recipe, int $repetitions, array $inputs, array $outputs)

getInputs() ​

php
public function getInputs() : array

Returns a list of items destroyed as ingredients of the recipe.

getOutputs() ​

php
public function getOutputs() : array

Returns a list of items created by crafting the recipe.

getPlayer() ​

php
public function getPlayer() : \pocketmine\player\Player

getRecipe() ​

php
public function getRecipe() : \pocketmine\crafting\CraftingRecipe

Returns the recipe crafted.

getRepetitions() ​

php
public function 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() ​

php
public function getTransaction() : \pocketmine\inventory\transaction\CraftingTransaction

Returns the inventory transaction involved in this crafting event.

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.