# Developer Overview Recap-API is a lightweight module that lets other plugins start recordings, trigger playback, and manage scenes programmatically. The API is available after Recap has been enabled. --- ## Maven / Gradle The Recap-API artifact is hosted on JitPack. Add it as a `compileOnly` / `provided` dependency so that Recap is not shaded into your plugin jar. **Repository:** *Gradle (Kotlin DSL):* ```kotlin repositories { maven("https://jitpack.io") } ``` *Maven:* ```xml <repository> <id>jitpack.io</id> <url>https://jitpack.io</url> </repository> ``` **Dependency:** *Gradle (Kotlin DSL):* ```kotlin compileOnly("com.github.Lodestones:Recap-API:1.0.0") ``` *Maven:* ```xml <dependency> <groupId>com.github.Lodestones</groupId> <artifactId>Recap-API</artifactId> <version>1.0.0</version> <scope>provided</scope> </dependency> ``` Add `Recap` as a dependency in your `paper-plugin.yml`: ```yaml dependencies: server: Recap: required: true load: BEFORE ``` --- ## Accessing the API The API is accessed through the static `RecapAPI` class. The API instance is available after Recap has been enabled. ```java import gg.lode.recap.api.RecapAPI; import gg.lode.recap.api.recording.IRecordingManager; import gg.lode.recap.api.scene.ISceneManager; IRecordingManager recordings = RecapAPI.getRecordingManager(); ISceneManager scenes = RecapAPI.getSceneManager(); ``` --- ## Common Operations ### Start and stop a recording ```java IRecordingManager manager = RecapAPI.getRecordingManager(); // Start recording a player manager.startRecording(player, "my_recording"); // Check if recording boolean active = manager.isRecording(player); // Stop and save manager.stopRecording(player); ``` ### Play a recording Playback is managed through the `ISceneManager` for both single recordings and scenes. ```java ISceneManager scenes = RecapAPI.getSceneManager(); // Play a scene at a location String sessionId = scenes.playScene("my_scene", player.getLocation()); // Stop a specific playback scenes.stopPlayback(sessionId); // Stop all playbacks scenes.stopAllPlaybacks(); ``` ### Create and compose a scene ```java ISceneManager scenes = RecapAPI.getSceneManager(); // Create a scene scenes.createScene("battle_replay"); // Add recordings with time delay and position offset scenes.addRecordingToScene("battle_replay", "player1_rec", 0, 0.0, 0.0, 0.0); scenes.addRecordingToScene("battle_replay", "player2_rec", 10, 5.0, 0.0, 3.0); // Play at a location scenes.playScene("battle_replay", location); ``` ### List and delete recordings ```java IRecordingManager manager = RecapAPI.getRecordingManager(); Collection<String> names = manager.getRecordingNames(); manager.deleteRecording("old_recording"); ``` --- ## Related Pages - [[Recap/API/RecapAPI]] — static accessor class - [[Recap/API/IRecordingManager]] — recording management interface - [[Recap/API/ISceneManager]] — scene and playback management interface - [[Recap/Server Owners/Overview]] — plugin overview