Sueta

Custom Enchantment API

1.0

Create custom enchantments with custom effects !

·Plugin

Summary

Want to create custom enchantments like those of minecraft vanilla? This plugin is for you.

EnchantmentAPI allows you to:

- Create custom enchantments

- Set enchantment's name, id, trigger ...

- Create custom enchantment effect

Installation

Put the file in your plugin folder.

To import the API, add it to your build path (like bukkit) and add this line in your plugin.yml:

depend: EchantmentAPI

Usage

To create custom enchantment, use CustomEnchantment class.

Constructors:

new CustomEnchantment(int id, String name, int lvl, EnchantmentTarget target)


new CustomEnchantment(int id, String name, int lvl, EnchantmentTarget target, int start, boolean cursed, boolean treasure, List<Enchantment> conf, EventTrigger eventtrigger boolean visible)

You can also create a file that extends the CustomEnchantment class:

public class MyEnchant extends CustomEnchantment{



public MyEnchant(int id, String name, int lvl, EnchantmentTarget target, int start, boolean cursed, boolean treasure, List<Enchantment> conf, EventTrigger eventtrigger, boolean visible) {

super(id, name, lvl, target, start, cursed, treasure, conf, damagetrigger, eventtrigger, visible); // TODO Auto-generated constructor stub }



@Override

public void enchantmentEffect(Event event, int lvl) {

// TODO Auto-generated method stub

          }

}

Supported events:
EntityDamageEvent, EntityDamageByEntityEvent, EntityDamageByBlockEvent, EntityAirChangeEvent, EntityCombustEvent, PlayerFishEvent, PlayerAnimationEvent, PlayerDeathEvent, BlockBreakEvent

Register custom enchantment:

EnchAPI.loadEnchantment(CustomEnchantment)

Set enchantment effect:

public void enchantmentEffect(Event event, int lvl) {
//TODO Enchantment effect here
           }

Enchant an item:

YourEnchantment.enchant(ItemStack item, int level)

Similar projects

Plugin →