Skip to content

EnchantmentInstance ​

final class · pocketmine\item\enchantment\EnchantmentInstance · source

Container for enchantment data applied to items.

Note: This class is assumed to be immutable. Consider this before making alterations.

Methods ​

__construct() ​

php
public function __construct(\pocketmine\item\enchantment\Enchantment $enchantment, int $level = 1)

getLevel() ​

php
public function getLevel() : int

Returns the level of the enchantment.

getType() ​

php
public function getType() : \pocketmine\item\enchantment\Enchantment

Returns the type of this enchantment.

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