Developer API
Whack Me exposes Bukkit events under dev.despical.whackme.api.event. Integrations can deny arena joins, observe normal or forced game endings, react to state transitions, capture leave reasons, and validate or replace statistic changes.
Dependency Setup
Section titled “Dependency Setup”Whack Me can be consumed from JitPack:
repositories { maven { url = 'https://jitpack.io' }}
dependencies { compileOnly 'com.github.Despical:WhackMe:main-SNAPSHOT'}repositories { maven("https://jitpack.io")}
dependencies { compileOnly("com.github.Despical:WhackMe:main-SNAPSHOT")}<repository> <id>jitpack.io</id> <url>https://jitpack.io</url></repository>
<dependency> <groupId>com.github.Despical</groupId> <artifactId>WhackMe</artifactId> <version>main-SNAPSHOT</version> <scope>provided</scope></dependency>For a production integration, pin a stable Whack Me release or commit instead of tracking a moving branch snapshot.
plugin.yml
Section titled “plugin.yml”name: YourPluginversion: 1.0.0main: your.package.YourPlugindepend: [WhackMe]Use softdepend: [WhackMe] only when your plugin can run safely without the integration.
Base Event Type
Section titled “Base Event Type”All public events extend:
dev.despical.whackme.api.event.WhackMeEventEach concrete Bukkit event owns a separate HandlerList.
Register a Listener
Section titled “Register a Listener”import dev.despical.whackme.api.event.player.PlayerJoinAttemptEvent;import org.bukkit.event.EventHandler;import org.bukkit.event.Listener;
public final class WhackMeListener implements Listener {
@EventHandler public void onJoinAttempt(PlayerJoinAttemptEvent event) { if (!event.getPlayer().hasPermission("network.whackme.play")) { event.setCancelled(true); event.getPlayer().sendMessage("You cannot join Whack Me yet."); } }}Register it normally from your plugin’s onEnable method.
Event Categories
Section titled “Event Categories”- Game Events: start, normal end, forced stop, and state change.
- Player Events: join attempt, leave reason, and statistic mutation.
The current API does not emit a separate event for individual point-block hits. Use PlayerStatisticChangeEvent with Statistics.LOCAL_SCORE, PLUS_BLOCKS, or MINUS_BLOCKS when statistic-level observation is sufficient.