Skip to content

GameStartEvent

The GameStartEvent is triggered after a TNT Run game enters active play. At this point, players have been moved to the start location, per-game scores have been reset, the survival round has started, block removal has been scheduled, and the start message has been broadcast.


  • Package: dev.despical.tntrun.api.event.game
  • Parent Class: GameEvent
  • Cancellable: No

This event inherits all utility methods from the base GameEvent class, allowing you to access the active Game instance and its arena.

MethodReturn TypeDescription
getGame()GameReturns the active Game instance that has started.
getArena()ArenaShortcut to return the Arena associated with the starting game.

When this event is called:

  • Player Setup: Players are already in their designated starting positions.
  • Score Initialization: The ScoreRegistry has been cleared and prepared for the new session.
  • Block Removal: The block removal system has been scheduled.
  • Ready State: The arena is now running active gameplay.

This example demonstrates how to send a custom message to all players when a TNT Run match starts.

import dev.despical.tntrun.api.event.game.GameStartEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
public class GameStartListener implements Listener {
@EventHandler
public void onGameStart(GameStartEvent event) {
String arenaId = event.getArena().getId();
event.getGame().getUsers().forEach(user -> {
user.getPlayer().sendMessage("TNT Run has started in arena: " + arenaId);
});
}
}