Skip to main content

Setting up

This page shows how to add the Reverse API to a Java 21 Bukkit plugin project. We will use the recorder for our first integration; the same discovery pattern applies to player and lobby.

Choose your API artifact

Choose the artifact for the role your integration will run on. Your build tool resolves its shared API dependencies automatically.

Add the dependency

Add the public API from Maven Central. Replace REVERSE_VERSION below with the published API version compatible with the Reverse release installed on your server.
Your project also needs its normal Bukkit/Spigot compile dependency. Add any public-signature libraries used by the APIs you call, such as Adventure for the relevant player SPI, as compile-only/provided dependencies too.
Do not shade the API into your plugin. Reverse supplies these classes at runtime. A second copy can break service lookup and event class identity.
To target player or lobby, replace api-recorder with the appropriate artifact from the table. Use com.marioded.reverse:api or com.marioded.reverse:api-gui only when your library specifically needs those shared contracts without a role-specific entry point.

Declare the runtime dependency

Add the actual Bukkit plugin name to your integration’s descriptor:
Use reverse-player or reverse-lobby for the corresponding integration. This makes Bukkit load your plugin after the required role. A jar being present does not guarantee its runtime initialized successfully, so we will still check discovery. If your whole plugin should work without Reverse, use an isolated optional integration and softdepend. An optional descriptor alone does not make eager references to absent API classes safe. See lifecycle handling.

Discover the active runtime

In your plugin’s onEnable, ask the recorder entry point for its provider:
ReverseRecorder.get() returns an Optional from Bukkit’s ServicesManager. If no provider was registered, the Optional is empty. Do not create a replacement implementation yourself. For the other roles, use the same pattern with ReversePlayer.get() or ReverseLobby.get().

Ready to start

We now have the right compile dependency and runtime load order. Next, we will introduce the service/session objects used by the first recording example. Services, recordings, and sessions →