PocketMine-MP 5.33.2 git-1133d49c924b4358c79d44eeb97dcbf56cb4d1eb
|
Public Member Functions | |
__construct (private Translatable|string $name, private int $rarity, private int $maxLevel, ?\Closure $minEnchantingPower=null, private int $enchantingPowerRange=50) | |
getMaxEnchantingPower (int $level) | |
getMaxLevel () | |
getMinEnchantingPower (int $level) | |
getName () | |
getRarity () | |
isCompatibleWith (Enchantment $other) | |
Manages enchantment type data.
Definition at line 34 of file Enchantment.php.
pocketmine\item\enchantment\Enchantment::__construct | ( | private Translatable|string | $name, |
private int | $rarity, | ||
private int | $maxLevel, | ||
?\Closure | $minEnchantingPower = null, | ||
private int | $enchantingPowerRange = 50 ) |
@phpstan-param null|(\Closure(int $level) : int) $minEnchantingPower
int | $enchantingPowerRange | Value used to calculate the maximum enchanting power (minEnchantingPower + enchantingPowerRange) |
Definition at line 46 of file Enchantment.php.
pocketmine\item\enchantment\Enchantment::getMaxEnchantingPower | ( | int | $level | ) |
Returns the maximum enchanting power value allowed for the particular level of the enchantment to be available in an enchanting table.
Enchanting power is a random value based on the number of bookshelves around an enchanting table and the enchantability of the item being enchanted. It is only used when determining the available enchantments for the enchantment options.
Definition at line 106 of file Enchantment.php.
pocketmine\item\enchantment\Enchantment::getMaxLevel | ( | ) |
Returns the maximum level of this enchantment that can be found on an enchantment table.
Definition at line 75 of file Enchantment.php.
pocketmine\item\enchantment\Enchantment::getMinEnchantingPower | ( | int | $level | ) |
Returns the minimum enchanting power value required for the particular level of the enchantment to be available in an enchanting table.
Enchanting power is a random value based on the number of bookshelves around an enchanting table and the enchantability of the item being enchanted. It is only used when determining the available enchantments for the enchantment options.
Definition at line 94 of file Enchantment.php.
pocketmine\item\enchantment\Enchantment::getName | ( | ) |
Returns a translation key for this enchantment's name.
Definition at line 61 of file Enchantment.php.
pocketmine\item\enchantment\Enchantment::getRarity | ( | ) |
Returns an int constant indicating how rare this enchantment type is.
Definition at line 68 of file Enchantment.php.
pocketmine\item\enchantment\Enchantment::isCompatibleWith | ( | Enchantment | $other | ) |
Returns whether this enchantment can be applied to the item along with the given enchantment.
Definition at line 82 of file Enchantment.php.