-
Notifications
You must be signed in to change notification settings - Fork 0
Developer API
Purdze edited this page Sep 24, 2026
·
2 revisions
Hounded fires Bukkit events that other plugins can listen to. They're all in the dev.marshall.hounded.api package and fired on the main thread.
| Event | When | Cancellable |
|---|---|---|
HoundedRoundStartEvent |
Just before a round starts, after Hounded has checked that it can | yes |
HoundedRoleChangeEvent |
Just before a player's role changes | yes |
HoundedRoundWinEvent |
A side won | no |
HoundedRoundStopEvent |
An admin stopped the round with /hounded stop
|
no |
HoundedRoundEndEvent |
Parent of the win and stop events: listen to it to hear about any end | no |
-
runners(),hunters(): player ids, in the order they were added. Never empty. -
headstartSeconds():0means the hunters are released at once. - Cancelling keeps the server in the lobby, and the admin who started the round is told another plugin cancelled it.
-
player(): the player's id. They may be offline when roles are cleared. -
from(),to():Optional<Role>.fromis empty for a new role, andtois empty when the role is removed. - Clearing a side fires one event per player. Cancelling one keeps just that player.
- Not fired during a round, because roles are locked then.
-
runners(): every runner in the round, including eliminated ones.hunters(): every hunter. -
huntTime(): time from the hunters' release to the end. Zero if it ended during the headstart. -
HoundedRoundWinEvent.winner():Role.RUNNERwhen the ender dragon dies,Role.HUNTERwhen every runner is out. - When these fire, the result has already been announced, and the game returns to the lobby right after.
Role is dev.marshall.hounded.game.Role (RUNNER or HUNTER).
Hounded isn't published to a Maven repository yet. Download the jar from the releases and compile against it:
// build.gradle.kts
dependencies {
compileOnly(files("libs/hounded-1.0.0.jar"))
}In your plugin.yml, add softdepend: [Hounded] if Hounded is optional, or depend: [Hounded] if it's required.
If Hounded is optional, only register your listener when it's enabled. Otherwise loading your listener class fails on servers without Hounded:
if (getServer().getPluginManager().isPluginEnabled("Hounded")) {
getServer().getPluginManager().registerEvents(new ManhuntListener(), this);
}public final class ManhuntListener implements Listener {
@EventHandler
public void onWin(HoundedRoundWinEvent event) {
Bukkit.getLogger().info(event.winner() + " won after " + event.huntTime().toMinutes() + " minutes");
}
@EventHandler
public void onStart(HoundedRoundStartEvent event) {
if (event.hunters().size() > 10) {
event.setCancelled(true); // e.g. enforce a team size limit
}
}
}Hounded is GPL-3.0. See the license if you ship code built on it.
Running a manhunt
Reference
Help