Create Custom Effects
Using AE's API for Effect Registration
To integrate custom effects into the AdvancedEnchantments system, developers must utilize the AEAPI
class from the net.advancedplugins.ae.api
package. The crucial method in this process is registerEffect
, defined in the AEAPI
class.
registerEffect
Method
registerEffect
MethodThis method is pivotal for registering new effects. It requires the plugin instance and the custom effect as arguments. The method returns a boolean indicating the success or failure of the registration process.
The AdvancedEffect
Class
AdvancedEffect
ClassTo create a custom effect, developers must extend the AdvancedEffect
class. This class serves as the base for all custom effects and provides several constructors and methods to define the effect's behavior.
Constructors
The AdvancedEffect
class offers multiple constructors, allowing developers to define various aspects of their custom effect:
Basic Constructor:
This constructor initializes the effect with a name.
Extended Constructor:
This variant allows adding a description and usage information.
Weighted Constructor:
Adds an additional parameter for weight, which can influence how the effect is handled or prioritized.
Methods
The AdvancedEffect
class contains methods to execute the effect:
executeEffect (LivingEntity target):
Triggers the effect for a living entity target.
executeEffect (Location target):
Activates the effect at a specific location.
Last updated