Interface Minigame

All Known Implementing Classes:
BattleshipGame, BlockBreakGame, BlockPartyGame, BombermanGame, ColorSplatGame, DodgeballGame, FishSlapGame, GymGame, HungryHungryHooksGame, KothTagGame, ParkourGame, RouletteGame, SpleefGame, StoryBlitz

public interface Minigame
Represents a minigame that can be played within the game environment. Each minigame has its own lifecycle methods and player management.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called after the minigame has been initialized.
    default boolean
    Returns true if players can join this game while it is already running.
    Gets the minigame configuration.
    List<org.bukkit.entity.Player>
    Gets the list of players currently in the minigame.
    void
    join(org.bukkit.entity.Player player)
    Adds the specified player to the minigame.
    void
    leave(org.bukkit.entity.Player player)
    Removes the specified player from the minigame.
    default void
    onCommand(org.bukkit.event.player.PlayerCommandPreprocessEvent event)
    Called when a player in this game runs a command.
    default void
    onDamage(org.bukkit.event.entity.EntityDamageByEntityEvent event)
    Called when a player in this game damages another player in this game.
    default void
    onDeath(org.bukkit.event.entity.PlayerDeathEvent event)
    Called when a player in this game dies.
    void
    Cleans up resources when the minigame is destroyed.
    void
    Initializes the minigame.
    default void
    onInteract(org.bukkit.event.player.PlayerInteractEvent event)
    Called when a player in this game interacts with a block or air.
    default void
    onMove(org.bukkit.event.player.PlayerMoveEvent event)
    Called when a player in this game moves.
    default void
    onSneak(org.bukkit.event.player.PlayerToggleSneakEvent event)
    Called when a player in this game toggles sneak.
    void
    removeItems(org.bukkit.entity.Player player)
    Removes all game-related items from the player's inventory.
    void
    Renders the minigame state.
    boolean
    Determines if the minigame should quit.
    default boolean
    Returns true if players should be teleported to the exit area when the game ends.
    void
    Updates the minigame state.
  • Method Details

    • onInit

      void onInit()
      Initializes the minigame.
    • afterInit

      void afterInit()
      Called after the minigame has been initialized.
    • update

      void update()
      Updates the minigame state.
    • render

      void render()
      Renders the minigame state.
    • onDestroy

      void onDestroy()
      Cleans up resources when the minigame is destroyed.
    • shouldQuit

      boolean shouldQuit()
      Determines if the minigame should quit.
      Returns:
      true if the minigame should quit, false otherwise
    • join

      void join(org.bukkit.entity.Player player)
      Adds the specified player to the minigame.
      Parameters:
      player - the player to add
    • leave

      void leave(org.bukkit.entity.Player player)
      Removes the specified player from the minigame.
      Parameters:
      player - the player to remove
    • getPlayers

      List<org.bukkit.entity.Player> getPlayers()
      Gets the list of players currently in the minigame.
      Returns:
      a list of players in the minigame
    • getConfig

      GameConfig getConfig()
      Gets the minigame configuration.
      Returns:
      the minigame configuration
    • removeItems

      void removeItems(org.bukkit.entity.Player player)
      Removes all game-related items from the player's inventory.
      Parameters:
      player - the player whose items will be removed
    • onInteract

      default void onInteract(org.bukkit.event.player.PlayerInteractEvent event)
      Called when a player in this game interacts with a block or air.
    • onMove

      default void onMove(org.bukkit.event.player.PlayerMoveEvent event)
      Called when a player in this game moves.
    • onDeath

      default void onDeath(org.bukkit.event.entity.PlayerDeathEvent event)
      Called when a player in this game dies.
    • onDamage

      default void onDamage(org.bukkit.event.entity.EntityDamageByEntityEvent event)
      Called when a player in this game damages another player in this game.
    • onSneak

      default void onSneak(org.bukkit.event.player.PlayerToggleSneakEvent event)
      Called when a player in this game toggles sneak.
    • onCommand

      default void onCommand(org.bukkit.event.player.PlayerCommandPreprocessEvent event)
      Called when a player in this game runs a command.
    • allowsConcurrentJoins

      default boolean allowsConcurrentJoins()
      Returns true if players can join this game while it is already running. Defaults to false (players must wait for the previous round to finish).
    • shouldTeleportOnExit

      default boolean shouldTeleportOnExit()
      Returns true if players should be teleported to the exit area when the game ends. Defaults to true; override to false for games that manage their own exit flow.