EnchantingHelper
Helper methods used for enchanting using the enchanting table.
Methods
enchantItem()
php
public static function enchantItem(\pocketmine\item\Item $item, array $enchantments) : \pocketmine\item\ItemenchantWithLevels() 5.46.0
php
public static function enchantWithLevels(\pocketmine\item\Item $item, int $levels, \pocketmine\utils\Random $random) : \pocketmine\item\ItemEnchants the item like an enchanting table option of the given level (vanilla enchant_with_levels loot function, without treasure enchantments). Books become enchanted books. Returns the item unchanged when nothing can be applied.
generateOptions()
php
public static function generateOptions(\pocketmine\world\Position $tablePos, \pocketmine\item\Item $input, int $seed) : arraygenerateSeed()
php
public static function generateSeed() : intGenerates a new random seed for enchant option randomization.
