JavaEnchantment 5.46.0
A Java Edition enchantment definition (data/minecraft/enchantment/*.json): the values the loot functions use (levels, weight, costs, supported/primary items and exclusive set).
Properties
$id
php
public readonly string $id$maxLevel
php
public readonly int $maxLevel$weight
php
public readonly int $weightMethods
__construct()
php
public function __construct(\pocketmine\loot\LootData $data, string $id, array $json)areCompatible()
php
public static function areCompatible(\pocketmine\loot\JavaEnchantment $a, \pocketmine\loot\JavaEnchantment $b) : boolEnchantment.areCompatible()
canEnchant()
php
public function canEnchant(string $itemId) : boolEnchantment.canEnchant() / isSupportedItem()
getMaxCost()
php
public function getMaxCost(int $level) : intgetMinCost()
php
public function getMinCost(int $level) : intgetMinLevel()
php
public function getMinLevel() : intisPrimaryItem()
php
public function isPrimaryItem(string $itemId) : boolEnchantment.isPrimaryItem()
