Extend the plugin¶
Part of Start here. You write Java and own a companion plugin (or plan to).
The versioned API exposes matches, lobbies, players, compass, scores, placeholders, modifiers, and queues, plus 15 events. This path takes you from dependency to your first working listener.
1. Add the artifact¶
repositories {
maven { url = uri("https://jitpack.io") }
}
dependencies {
compileOnly("com.github.jruk8:JManhunt-API:<commit-sha>")
}
Declare the load order in your plugin.yml:
2. Look it up and register¶
Optional<JManhuntApi> api = JManhuntApi.lookup();
AddonHandle handle = api.orElseThrow().registerAddon(this, new ApiVersion(1, 0, 0));
lookup() is empty until JManhunt has enabled; registerAddon fails
fast when the engine is too old for your minimum version.
3. Listen to one event¶
@EventHandler
public void onGameBegin(GameBeginEvent event) {
long matchId = event.getMatchId();
getLogger().info("Match " + matchId + " began.");
}
4. Verify¶
Run the server, start a match, and confirm your log line lands when the
game begins. Then read the state for real: api.matches().match(matchId)
gives you the roster, roles, and winner.
Want more?¶
- Full setup and versioning? API.
- Every state read? Reading State.
- All 15 events plus prepare hooks? Events.
- In-game tooling? Developer Tools.