-
Notifications
You must be signed in to change notification settings - Fork 1
API: usage
Timothé ROSAZ edited this page Apr 16, 2025
·
9 revisions
This plugin has been made with extensibility in mind. You'll find a large panel of customizable elements.
Using maven, add the following dependency (inside the <depencendies> tag in your pom.xml) :
<dependency>
<groupId>fr.jamailun.paper</groupId>
<artifactId>ultimate-spell-system-api</artifactId>
<version>2.0.0</version>
</dependency> Check the latest version here.
Don't forgot to add a dependency in your plugin.yml, so that the dependency will be loaded before your plugin.
Then, inside your code, you can use the UltimateSpellSystem entry-point.
import org.bukkit.plugin.java.JavaPlugin;
import fr.jamailun.ultimatespellsystem.api.UltimateSpellSystem;
public class ExamplePlugin extends JavaPlugin {
@Override
public void onEnable() {
boolean ussOk = UltimateSpellSystem.isValid();
// Get the item-binder, the spells-manager, ...
}
}Please, not that using USS in the onLoad() phase way throw NPE. Wait for the onEnable().
To listen to an event, simply proceed with a class Listener & @EventHandler.
Here's a list of events you can listen to :
-
BoundSpellCastEvent: called when aSpellis cast from a boundItemStack. Maybe Cancellable. -
EntityCastEvent: called when aSpellis cast by anEntity. Cancellable. -
EntitySummonedEvent: called when aSpellsummons aSpellEntity. -
ItemBoundEvent: called when aSpellis bound to anItemStack. -
ItemBoundEvent: called when aSpellis unbound from anItemStack.