Promotion background
Summer Sale IS HERE!
10% off limited time offer!
Ends in
00
H
00
M
00
S
limited time offer SAVE 10% NOW โ†’
DEVELOPER ๐ŸŒ API

๐ŸŽž๏ธ Custom Animations

On this page, you will find our API to create your own set of animations

triangle-exclamation

The API is only available for the premium version of the plugin.

Create your own opening phase animations and register them at runtime through the API.

#1. Create Your Phase Class

Extend OpeningPhaseAnimation and implement the lifecycle methods:

public class YourPhaseAnimation extends OpeningPhaseAnimation<EmptyOpeningPhaseData> {

    public YourPhaseAnimation(OpeningCrateAnimation animation, OpeningPhaseType type,
            EmptyOpeningPhaseData data) {
        super(animation, type, data);
    }

    @Override
    public void load() {
    }

    @Override
    public void tick() {
    }

    @Override
    public void unload() {
    }

}

#2. Register on Enable

Register your phase during addon startup and unregister it on shutdown:

public void onEnable() {
        registerPhase(
                new OpeningPhaseType(PhaseType.FIRST, "YOUR_PHASE_IDENTIFIER",
                "Your Display Name",
                XMaterial.STONE, ServerVersion.v1_16_R1,
                            new XMaterial[] {}, EmptyOpeningPhaseData.class,
                            (animation, type, data) -> new YourPhaseAnimation(animation,
                                    type, (EmptyOpeningPhaseData) data),
                            () -> new EmptyOpeningPhaseData()));
}

public void onDisable() {
        for (final OpeningPhaseType type : this.registeredPhases) {
            OpeningPhaseType.unregisterPhase(type);
        }
}

private void registerPhase(OpeningPhaseType phase) {
        // Registering first phase animations
        OpeningPhaseType.registerPhase(phase);

        // Caching to unload later on
        this.registeredPhases.add(phase);
}

#Good Practices

  • Use unique identifiers for each custom phase.
  • Keep heavy logic out of tick() when possible.
  • Always unregister phases in onDisable().
  • Test phases on the same Minecraft version as production.

#Need Addon Setup First?

If you have not created your addon bootstrap yet, start with ๐Ÿ”ง Custom Addons.

Last updated 3 months ago
My Cart (0 items)

Oops... looks like the spiders padded through here

Add products to your cart and remove them from here Lets buy