Skip to content

API: usage

Timothé ROSAZ edited this page Sep 25, 2025 · 9 revisions

This plugin has been made with extensibility in mind. You'll find a large panel of customizable elements.

How-to: add the dependency

Using maven, add the following dependency and repository in your pom.xml :

<repositories>
    <!-- Your other repositories... -->
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependencies>
    <!-- Your other dependencies ... -->
    <dependency>
        <groupId>com.github.jamailun.UltimateSpellSystem</groupId>
        <artifactId>ultimate-spell-system-api</artifactId>
        <version>2.5.1</version>
    </dependency> 
</dependencies>

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.

Java entry-point

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, ...
    }
}

Warning

Using USS in the onLoad() phase may throw NPE. Wait for the onEnable().

How-to : write a spell

After the first startup, you'll find the folder /plugins/UltimateSpellsSystem/spells. You can drop any file in it (.uss extension is optional). Every file will be loaded at startup, or you can do /uss reload to reload spells from the file-system.

For the syntax, you can learn more here.

If you need examples to get started, check the examples folder on git.

How-to: Listen to events

To listen to an event, simply proceed with a class Listener & @EventHandler.

Events list

Here's a list of events you can listen to :

  • BoundSpellCastEvent : called when a Spell is cast from a bound ItemStack. Maybe Cancellable.
  • EntityCastEvent : called when a Spell is cast by an Entity. Cancellable.
  • EntitySummonedEvent : called when a Spell summons a SpellEntity.
  • ItemBoundEvent : called when a Spell is bound to an ItemStack.
  • ItemBoundEvent : called when a Spell is unbound from an ItemStack.

How-to : register a custom element

Check the registries wiki page.

Clone this wiki locally