- Denizen Version
- b6996-DEV
This a scripter utility to make custom enchants a little easier to work with. It adds two events and a custom command. The command allows you to enchant an item by simply holding the item in your hand, typing the name of the enchant, and an optional level parameter as well. It will add the enchantment to the item, along with any custom lore, to make it appear just like a vanilla enchant. The command will also work with vanilla enchants, but does not add the lore, since that is handled by vanilla.
The events are when you enchant an item via an enchanting table, or by adding a book in the anvil. In both cases, the system does not touch vanilla enchantments (or custom enchants from other plugins, as it's assumed they're already handling their own enchant systems), but in the case of denizen enchants, adds the required lore. As well, the anvil event also handles if the book is lower level/higher level/equal level, and applies the enchantment as per vanilla rules. This way, all you have to do is create your own enchants using an enchantment script container and the rest is taken care of for you.
Finally, the two events and command all fire off custom events as well. For each denizen enchant, it will fire a custom event before adding the enchant to the item. Cancelling the custom event will cancel the script and all further processing. The custom events pass along information like item lore, enchantments, level, and of course, the item itself. Modifying these and returning them will propagate into the actual events, so if you have an enchant that needs to flag an item when it's enchanted, or you'd like to do extra processing, the custom events make that easy. Check the script directly for a better idea of how that part of the system works.
The events are when you enchant an item via an enchanting table, or by adding a book in the anvil. In both cases, the system does not touch vanilla enchantments (or custom enchants from other plugins, as it's assumed they're already handling their own enchant systems), but in the case of denizen enchants, adds the required lore. As well, the anvil event also handles if the book is lower level/higher level/equal level, and applies the enchantment as per vanilla rules. This way, all you have to do is create your own enchants using an enchantment script container and the rest is taken care of for you.
Finally, the two events and command all fire off custom events as well. For each denizen enchant, it will fire a custom event before adding the enchant to the item. Cancelling the custom event will cancel the script and all further processing. The custom events pass along information like item lore, enchantments, level, and of course, the item itself. Modifying these and returning them will propagate into the actual events, so if you have an enchant that needs to flag an item when it's enchanted, or you'd like to do extra processing, the custom events make that easy. Check the script directly for a better idea of how that part of the system works.