PlayerItemEnchantEvent
Extends PlayerEvent
Implements Cancellable
Called when a player enchants an item using an enchanting table.
Methods
__construct()
php
public function __construct(\pocketmine\player\Player $player, \pocketmine\inventory\transaction\EnchantingTransaction $transaction, \pocketmine\item\enchantment\EnchantingOption $option, \pocketmine\item\Item $inputItem, \pocketmine\item\Item $outputItem, int $cost)getCost()
php
public function getCost() : intReturns the number of XP levels and lapis that will be subtracted after enchanting if the player is not in creative mode.
getInputItem()
php
public function getInputItem() : \pocketmine\item\ItemReturns the item to be enchanted.
getOption()
php
public function getOption() : \pocketmine\item\enchantment\EnchantingOptionReturns the enchantment option used.
getOutputItem()
php
public function getOutputItem() : \pocketmine\item\ItemReturns the enchanted item.
getTransaction()
php
public function getTransaction() : \pocketmine\inventory\transaction\EnchantingTransactionReturns the inventory transaction involved in this enchant event.
