Skip to content

Developer API

The Carousel API allows developers to hook into the plugin’s lifecycles and modify player interactions. All custom events in the plugin inherit from the base CarouselEvent class.


To start using the API, you need to add the Carousel JAR file to your project’s dependencies. Create a folder named libs in your project’s root directory and place the carousel-x.x.x.jar file inside it.

dependencies {
compileOnly files('libs/carousel-x.x.x.jar')
}
plugin.yml
name: YourPlugin
version: 1.0.0
main: your.package.Main
depend: [Carousel]

Every event provided by the Carousel API extends the CarouselEvent class. This ensures consistent access to the carousel instance data across all interactions.

public abstract class CarouselEvent extends Event {
private static final HandlerList HANDLER_LIST = new HandlerList();
protected final Carousel carousel;
public CarouselEvent(Carousel carousel) {
this.carousel = carousel;
}
public Carousel getCarousel() {
return carousel;
}
@NotNull
@Override
public HandlerList getHandlers() {
return HANDLER_LIST;
}
public static HandlerList getHandlerList() {
return HANDLER_LIST;
}
}

Explore the specific events triggered during player interactions: