promotional bannermobile promotional banner

CustomEnchantment API

Abandoned
Create custom enchantments with custom effects !

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)

Constructor args:

- Integer id: Enchantment ID in Minecraft (do not use a vanilla enchantment ID ex=1  ex=100

- String name: Enchantment display name

- EnchantmentTarget target: The enchantment type. Example: ALL, BREAKABLE, ARMOR, FEET, LEGS...

Integer start: The minimal enchantment level (default: 0)

- Boolean cursed: Is the enchantment a curse ?

- Boolean treasure: Is the enchantment a treasure enchatment ?  (as mending, frost walk ect...)

- List<Enchantment> conf: Enchantment in conflict with that one (Example: Mending cannot be used with Infinity

- EventTrigger trigger: The trigger event (Example: EntityDamageEvent, BlockBreakEvent...)

- Boolean visible: Is the enchantment is visible in the item lore ?

 

 

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: 

Register custom enchantment: EntityDamageEvent, EntityDamageByEntityEvent, EntityDamageByBlockEvent, EntityAirChangeEvent, EntityCombustEventPlayerFishEvent, PlayerAnimationEvent, PlayerDeathEventBlockBreakEvent

 

Register custom enchantments:

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)

 

 Set Enchantment Effect, use abstract method enchantmentEffect(Event, int):

public void enchantmentEffect(Event event, int lvl){

//TODO Code here

}

 

The CustomEnchantment API Team

profile avatar
  • 1
    Followers
  • 3
    Projects
  • 9.5K
    Downloads

More from Forge_User_50434340

  • In-game console project image

    In-game console

    • 6.0K
    • Bukkit Plugins

    Manage your server with Spigot or Bungeecord in game!

    • 6.0K
    • September 1, 2018
    • Bukkit Plugins
    • +4
  • File Manager project image

    File Manager

    • 1.5K
    • Bukkit Plugins

    File manager for minecraft hosts !

    • 1.5K
    • July 27, 2018
    • Bukkit Plugins
    • +1
  • In-game console project image

    In-game console

    • 6.0K
    • Bukkit Plugins

    Manage your server with Spigot or Bungeecord in game!

    • 6.0K
    • September 1, 2018
    • Bukkit Plugins
    • +4
  • File Manager project image

    File Manager

    • 1.5K
    • Bukkit Plugins

    File manager for minecraft hosts !

    • 1.5K
    • July 27, 2018
    • Bukkit Plugins
    • +1