Skip to content

IncompatibleEnchantmentRegistry ​

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

Manages which enchantments are incompatible with each other. Enchantments can be added to groups to make them incompatible with all other enchantments already in that group.

Methods ​

areCompatible() ​

php
public function areCompatible(\pocketmine\item\enchantment\Enchantment $first, \pocketmine\item\enchantment\Enchantment $second) : bool

Returns whether two enchantments can be applied to the same item.

register() ​

php
public function register(string $tag, array $enchantments) : void

Register incompatibility for an enchantment group.

All enchantments belonging to the same group are incompatible with each other, i.e. they cannot be added together on the same item.

unregister() ​

php
public function unregister(string $tag, array $enchantments) : void

Unregister incompatibility for some enchantments of a particular group.

unregisterAll() ​

php
public function unregisterAll(string $tag) : void

Unregister incompatibility for all enchantments of a particular group.

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