EnchantmentAPI

Lifesteal Enchantment

Overview

The plugin is made primarily for developer usage as it doesn't do much on its own. It does however provide very easy access into creating custom enchantments that look like normal enchantments and can be added through both the enchanting table and programmatically! Now developers can make new enchantments such as life steal even with very little code!

Don't want to code your own enchantments? Visit EnchantmentPack for a large collection of enchantments!

Features

Silly Enchantment
(a lv5190 enchantment)

  • An extendable class for plugins for simple setting up of enchantments
  • An abstract CustomEnchantment class for quick enchantment creation
  • Automatic effect activation when the enchanted item hits something
  • Automatic enchanting table integration
  • Enchantments are easily added onto any item
  • The max level of enchantments is that of an integer variable
  • Large enchantment levels should probably be avoided though (above is a good reason why)
  • Any item can use the enchantments (torches, signs, you name it)
  • Enchantment effects can be for attacking, defending, breaking blocks, equipping, unequipping, or mix of them all!
  • Any enchantment can be completely disabled by editing the config
  • Configurable weights, max levels, conflict groups, and item sets for all enchantments
  • All items can be used in enchanting tables if they have an enchantment bound to them as of v3.0!
  • Anvils can now handle custom enchantments very similar to any vanilla enchantment (v4.0)
  • Randomly generated names can be applied to enchanted items! (You can turn this off)
  • Permissions per enchantment (with v4.10)

Statistics

New Enchantment Table Mechanics

For an in-depth explanation on the new mechanics for the enchantment table (because it needed some to get every item to work), go here
Thanks to Diemex for coming up with this idea :)

Config

A config file is generated as new enchantments are added. Adding more enchantments later will simply automatically add onto the config with its default values the next time you reload your server. All changes you make will override the enchantment values. You can edit them while the server is running and reloading the server will apply them.

The config allows you to change the following things:

  • weight: chance of getting the enchantment from a table
  • items: the items that can receive the enchantment from a table
  • enabled: whether or not the enchantment can be obtained and used
  • table: whether or not the enchantment can be obtained in the enchantment table
  • group: the conflict group of the enchant - items in the same group will conflict unless its the default group
  • max: the maximum level for the enchantment
  • base: the minimum modified enchantment level that can get the enchantment
  • interval: the amount of modified enchantment levels above the base it takes to get the next tier

    Vanilla enchantments cannot be completely disabled, although you can stop them from being received in the enchantment table.

    Disabled custom enchantments will no longer work on items that had received it before disabling it.

Commands

  • /enchantapi list [page] - Providing the page gives a detailed list while no page just shows you the complete list
  • /enchantapi reload - Reloads the plugin data
  • /enchantapi book - gives you a book with descriptions for every enchantment
  • /enchantapi add <enchantName> [enchantLevel] - Supports vanilla names such as "sharpness" as of v4.0!
  • /enchantapi stats <item> <level> - Displays probabilities for every possible enchantment for the item at the given level (item name or item ID)
  • /enchantapi graph <item> <enchant> - Displays a graph for probabilities of the enchantment on the item over all 30 levels (item name or item ID)
    Yes, you do have to include spaces for the addenchant command with the enchantment name!
    Note: the graph takes 3-5 seconds to generate because it generates 3,000,000 samples in order to get reliable results!

    graph command

Permissions

  • EnchantmentAPI.list - access to the list command
  • EnchantmentAPI.book - access to giving yourself a description book
  • EnchantmentAPI.admin - access to adding enchants to items, reloading the plugin, and viewing statistics
  • EnchantmentAPI.table - access to custom enchantments from the table
  • EnchantmentAPI.names - access to random names from enchanting (needs table as well)

    Version 4.10 permissions
  • EnchantmentAPI.enchant - access to all enchantments in the table (default is true)
  • EnchantmentAPI.enchant.enchantName - access to the enchantment in the table (replace 'enchantName' with the name of the enchantment with all lowercase letters and no spaces)

    Version 4.11 permissions
  • EnchantmentAPI.enchant.vanilla - access to all vanilla enchantments (default is true)
    Note, with this permission added, removing the permission EnchantmentAPI.enchant will still leave players with access to vanilla enchantments. You must remove both for them not to have the access!

Javadocs, Source Code, and Tutorials

Javadocs

Javadocs are found here
Thanks to JefferiesTube for the space for the javadocs!

Source Code

Github

Tutorials

Troubleshooting

  • Losing items in the enchanting table? Try deleting your config files as they are probably outdated
  • If the you start getting loading problems that point to EnchantPlugin saying that the class cannot be loaded, try adding this line to your plugin.yml:
depend: [EnchantmentAPI]

Example Enchantments

Forum

I have created a forum for this that you can submit ideas, projects you are working on, and bugs to. Its completely optional but it might help organize what's going on with this project :)

Special Thanks

  • zag09 for finding several bugs and making suggestions
  • JefferiesTube for the Javadocs space and the bountiful suggestions
  • Diemex for cleaning up my sloppy code

Like the project?

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of madprofessor83 madprofessor83 Aug 01, 2015 at 07:03 UTC - 0 likes

    For the EnchantmentPack, is there any way to apply these to books? This way instead of having to do a command it can just be done with an enchanted book.

  • Avatar of iTzCascadexX iTzCascadexX Jul 25, 2015 at 16:26 UTC - 0 likes

    @ChristianPlayzMC: Go

    I doubt I'll have any luck with this, but I've just disabled all pvp skills for now, Swords seems to work fine. If anyone has a work around, let me know asap.

  • Avatar of blackyamato blackyamato Jul 25, 2015 at 13:42 UTC - 0 likes

    Bug Report.

    Server Environment:
    ・Spigot 1.8.7 (Build 2015.7.25)
    ・EnchantmentAPI 4.27
    ・EnchantActivePack 2.11
    ・EnchantPassivePack 2.11
    ・EnchantPotionPack 2.11

    Report:
    ・This error is continuously displayed on the console when they use an enchantment.
    http://pastebin.com/GStyarZF

  • Avatar of ChristianPlayzMC ChristianPlayzMC Jul 23, 2015 at 23:34 UTC - 0 likes

    @iTzCascadexX: Go

    Yeah i have same issue. Happened so much today. I tried disabling acrobatics/ some of axes abilities and didnt help at all. Perhaps some of the issue could be in EnchantmentPack or API revolving around the effects or uses of the enchants?

  • Avatar of UD13N0W UD13N0W Jul 23, 2015 at 12:47 UTC - 0 likes

    @JBuscus101: Go

    to expand on this issue, you can see the item pop up for a quick moment before it gets removed from the output slot of the anvil :s

  • Avatar of JBuscus101 JBuscus101 Jul 23, 2015 at 12:11 UTC - 0 likes

    Players can't rename items in an Anvil with this installed is there a config option somewhere or is it a bug?

  • Avatar of denon2010 denon2010 Jul 23, 2015 at 02:45 UTC - 0 likes

    About EnchantmentPack.How can I change Enchantments language? config.yml is not related to the settings.

  • Avatar of UD13N0W UD13N0W Jul 21, 2015 at 16:56 UTC - 0 likes

    hey, I'd like to make a request if it isn't already available( I haven't been able to find a way) to disable the enchants all together for any player that does not have the permission to use an enchant. for instance, i make an item with some enchants and if another player without perms finds this item, they can use the enchants.

    the main reason for this request is because i wrote a skript(http://dev.bukkit.org/bukkit-plugins/skript/) that runs commands, removes perm nodes and reapplies them when players enter and leave regions and am using this to prevent other plugin interactions within a given region.

    this would be so awesome!!

  • Avatar of Clifspeare16 Clifspeare16 Jul 20, 2015 at 17:11 UTC - 0 likes

    Players are complaining that they cannot rename items in anvils, including nametags. Why is this?

  • Avatar of iTzCascadexX iTzCascadexX Jul 20, 2015 at 09:29 UTC - 0 likes

    Not sure if this is a Bug or I'm doing something wrong, however:

    Using latest possible (not paid) versions of EnchantmentAPI and all 4 of the EnchantmentPacks. McMMO seems to break when using axes/acrobatics whenever you hit an enemy player, but works fine when attacking mobs. It spams the chat with "Critical Hit" or "Dodged" then the Server freezes, and crashes, and rolls back.

    Any ideas?

Facts

Date created
May 31, 2013
Category
Last update
Jun 27, 2015
Development stage
Release
Language
  • enUS
License
MIT License
Curse link
EnchantmentAPI
Downloads
38,854
Recent files

Authors