Skip to content

The Snake API

The Snake exposes Bukkit events for round lifecycle changes, player input, and score updates. Event classes live under dev.despical.snake.api.event and are dispatched on the primary server thread.



public final class SnakeIntegration extends JavaPlugin implements Listener {
@Override
public void onEnable() {
getServer().getPluginManager().registerEvents(this, this);
}
}

Add the dependency so your plugin loads after Snake:

softdepend:
- Snake

Use depend instead if your plugin cannot function without The Snake.


  • Events are synchronous Bukkit events.
  • None of the current public event classes implements Cancellable.
  • GameStartEvent fires before the board is snapshotted and before active movement starts.
  • GameEndEvent fires after the result is identified and its message is sent, but before the ending timer returns the player.
  • NewScoreEvent sees the already incremented score.