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 futhead_ZacRiley2 futhead_ZacRiley2 Jul 03, 2015 at 12:41 UTC - 0 likes

    @Eniripsa96 Hi mate, Just wondering how you could change the names of your enchants on the enchant package or add new ones? New to all this stuff but really enjoy this plugin! Thanks

  • Avatar of 0ct0ber 0ct0ber Jun 27, 2015 at 23:25 UTC - 0 likes

    @Eniripsa96: Go

    Alright. Well I actually decided to make my own, standalone enchantment balancing plugin that modifies vanilla enchantment effects (Check my profile if you want to see it :P)

    As for the books I think it would be very helpful, as players on my server are beginning to complain that they are losing their items (as their items turn into books with missing texture and never turn back), although it only happens every once and a while, oddly...

    Last edited Jun 27, 2015 by 0ct0ber
  • Avatar of Eniripsa96 Eniripsa96 Jun 27, 2015 at 02:22 UTC - 0 likes

    Uploaded a new version that fixes the following issues:

    • Fixed anvils using up double cost for repairs
    • Fixed items disappearing sometimes when using anvils in survival mode

    @0ct0ber: Go

    I don't have a way to modify vanilla enchantments. I could add the disabling for the custom enchanting in the table, but it may take a little bit.

    @Idkaname8: Go

    Are you sure it is caused by this plugin? If so, are there certain enchantments you are using when this is happening?

    @DuckweedVN: Go

    Are you enchanting without lapis or something? The source of that error seems to be it trying to handle the lapis cost. If you aren't on a 1.8+ server, the most recent version doesn't support it. You may need to grab an earlier version of the plugin.

    Last edited Jun 27, 2015 by Eniripsa96

    BFAK:86513,955c39aa0fd005d53a0df93f256769ca83f60e42d36afbeaf01fab5fcc205630My Plugins: SkillAPI | Parties | MCCore | LegendaryWeapons | EnchantmentAPI | EnchantmentPack

  • Avatar of 0ct0ber 0ct0ber Jun 23, 2015 at 17:47 UTC - 0 likes

    How would I go about adding effects to existing vanilla effects?

    I'm also wondering if you can disable the book method of enchanting in the config... I don't want to enchant items that aren't enchantable in vanilla, and sometimes the books don't turn back and display missing texture.

  • Avatar of stonerbros stonerbros Jun 22, 2015 at 00:47 UTC - 0 likes

    @xvrlee: Go

    same.

  • Avatar of Idkaname8 Idkaname8 Jun 21, 2015 at 02:59 UTC - 0 likes

    Hi, I am having a bit of a bug.

    When I am hit half a heart below a heart, for example, starting at 10 hearts going to 8.5, I would lose a permanent heart, so it would only heal up to 9 hearts, and so on, until you have 1 heart max and only half a heart, and when you respawn, you still have the 1 heart. Is there a fix?

  • Avatar of xvrlee xvrlee Jun 20, 2015 at 10:07 UTC - 0 likes

    Anvil does not working, it only works creative mode

  • Avatar of DuckweedVN DuckweedVN Jun 18, 2015 at 09:57 UTC - 0 likes

    Error ... Can you help me? T^T

    http://pastebin.com/9bD1Pi3c

  • Avatar of BrightDanny BrightDanny Jun 16, 2015 at 12:51 UTC - 0 likes

    @lorinthios: Go

    The anvil removes the level requirement twice.

    @ Eniripsa96, you had this problem in the past too, remember? Perhaps it's the same issue again.

  • Avatar of lorinthios lorinthios Jun 08, 2015 at 06:03 UTC - 0 likes

    Issue with my members items poofing out of existance from anvils. Started happening after I added this API. Hopefully you know the issue as there is no stacktrace!

    Let me know!

    Lor

    Forge of Worlds

    A Custom RPG Sandbox experience

Facts

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

Authors