Sueta
EN

EnchantAPI

1.0.2

Simple way to create Custom Enchants

·Plugin


The EnchantAPI is a simple way of creating Custom Enchants inside your plugins! This API contains a simple method to create Enchants!


The Enchant API contains a simple method to create a new Enchantment!
The following is an example of the method:

private  EnchantManager newEnchant  =   new  EnchantManager  (   101  ,  "New Enchant"  ,  1  ,  10   )   ;

Break Down:
101:
This is the enchantment ID, each enchantment has to have a unique ID.
"New Enchant": This is the name of the enchantment when added to an item .
1:
This is the minimum level of the enchantment
10: This is the maximum level of the enchantment.

Registering your new enchantment:
Each enchantment has to be registered in your plugins onEnable. Using the enchantment from the previous example, your onEnable should look like:

@Override 
 public   void  onEnable  (   )   {  
    newEnchant.  getEnchantment   (   )   ;  
 }

Adding the Enchantment to an item.
The EnchantManager has a method to be able to easily add the enchantment to an item. Here is an example of this:

newEnchant.Enchant(item, level);

The level is also converted into roman numerals and is in the same style as vanilla minecraft enchantments.

If this API is used, the api will be one of the plugins dependencies. Not adding the API to the server will stop the plugin from working!

Please leave a good review if you like this API! Please message me on discord (iStrafeEU#7202#) if you come across any bugs!

Similar projects

Plugin →