Skip to content

EnchantingOption ​

class · pocketmine\item\enchantment\EnchantingOption · source

Represents an option on the enchanting table menu. If selected, all the enchantments in the option will be applied to the item.

Methods ​

__construct() ​

php
public function __construct(int $requiredXpLevel, string $displayName, array $enchantments)

getDisplayName() ​

php
public function getDisplayName() : string

Returns the name that will be translated to the 'Standard Galactic Alphabet' client-side. This can be any arbitrary text string, since the vanilla client cannot read the text anyway. Example: 'bless creature range free'.

getEnchantments() ​

php
public function getEnchantments() : array

Returns the enchantments that will be applied to the item when this option is clicked.

getRequiredXpLevel() ​

php
public function getRequiredXpLevel() : int

Returns the minimum amount of XP levels required to select this enchantment option. It's NOT the number of XP levels that will be subtracted after enchanting.

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