-
-
Notifications
You must be signed in to change notification settings - Fork 3
Enchantments
Enchantments are managed by the EnchantmentRegistry
. There are no enchantments registered by default. You have to register them yourself.
To create an enchantment you need to create an instance of the Enchantment
class. The constructor takes the following parameters:
- name
- id
- minLevel
- maxLevel
- rarity
To register an enchantment you need to call the register
method.
Since some enchantments are incompatible with each other or can not be applied to every item you also need to specify the incompatibilities.\
Registering an enchantment incompatibility is done by calling the addIncompatibility(enchantment, enchantment2)
method.
Adding an item incompatibility is done by calling the addItemCompatibility(item, testFunction)
method.
The testFunction
is a function that takes an item as a parameter and returns a boolean (true -> incompatible).