Skip to content

JavaEnchantment 5.46.0 ​

final class · pocketmine\loot\JavaEnchantment · source

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 $weight

Methods ​

__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) : bool

Enchantment.areCompatible()

canEnchant() ​

php
public function canEnchant(string $itemId) : bool

Enchantment.canEnchant() / isSupportedItem()

getMaxCost() ​

php
public function getMaxCost(int $level) : int

getMinCost() ​

php
public function getMinCost(int $level) : int

getMinLevel() ​

php
public function getMinLevel() : int

isPrimaryItem() ​

php
public function isPrimaryItem(string $itemId) : bool

Enchantment.isPrimaryItem()

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