Skip to content

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.


Whack Me can be consumed from JitPack:

repositories {
maven { url = 'https://jitpack.io' }
}
dependencies {
compileOnly 'com.github.Despical:WhackMe:main-SNAPSHOT'
}

For a production integration, pin a stable Whack Me release or commit instead of tracking a moving branch snapshot.


name: YourPlugin
version: 1.0.0
main: your.package.YourPlugin
depend: [WhackMe]

Use softdepend: [WhackMe] only when your plugin can run safely without the integration.


All public events extend:

dev.despical.whackme.api.event.WhackMeEvent

Each concrete Bukkit event owns a separate HandlerList.


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.


  • 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.