Interface DuelAPI


public interface DuelAPI
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    void
    end(@NotNull org.bukkit.event.entity.PlayerDeathEvent event)
    Ends the duel after one player has been defeated.
    void
    endRound(@NotNull org.bukkit.event.entity.PlayerDeathEvent event)
    Ends the current round of the duel and proceeds to the next round, or ends the duel if no rounds remain.
    void
    Forces the closing of all ongoing duels.
    @NotNull @UnmodifiableView Map<UUID,DuelSession>
    Gets all active duel sessions.
    boolean
    inDuel(@NotNull org.bukkit.entity.Player player)
    Checks if a player is currently in a duel.
    boolean
    isSpectating(@NotNull org.bukkit.entity.Player player)
    Checks if a player is currently spectating a duel.
    void
    leave(@NotNull org.bukkit.entity.Player player)
    Allows a player to leave the duel, either by quitting or being forcibly removed.
    void
    leaveSpectating(@NotNull org.bukkit.entity.Player spectator, boolean messages)
    Allows a spectator to leave the duel they are spectating.
    void
    remove(@NotNull org.bukkit.entity.Player player)
    Removes a player from all duel-related data, including their session, teams, and other information.
    void
    spectate(@NotNull org.bukkit.entity.Player spectator, @NotNull org.bukkit.entity.Player player)
    Allows a player to spectate an ongoing duel.
    void
    start(@NotNull org.bukkit.entity.Player player1, @NotNull org.bukkit.entity.Player player2, String kit, int rounds)
    Starts a duel between two players with a specific kit and number of rounds.
    void
    start(@NotNull org.bukkit.entity.Player player1, @NotNull org.bukkit.entity.Player player2, String kit, int rounds, String display)
    Starts a duel between two players with a specific kit, number of rounds, and arena display name.
  • Method Details Link icon

    • start Link icon

      void start(@NotNull @NotNull org.bukkit.entity.Player player1, @NotNull @NotNull org.bukkit.entity.Player player2, String kit, int rounds)
      Starts a duel between two players with a specific kit and number of rounds. The duel is set as a best-of-x format.
      Parameters:
      player1 - The first player in the duel.
      player2 - The second player in the duel.
      kit - The name of the kit to be used in the duel.
      rounds - The number of rounds in the duel (first of x).
    • start Link icon

      void start(@NotNull @NotNull org.bukkit.entity.Player player1, @NotNull @NotNull org.bukkit.entity.Player player2, String kit, int rounds, String display)
      Starts a duel between two players with a specific kit, number of rounds, and arena display name. The duel is set as a best-of-x format, and the display name is used to find the corresponding arena.
      Parameters:
      player1 - The first player in the duel.
      player2 - The second player in the duel.
      kit - The name of the kit to be used in the duel.
      rounds - The number of rounds in the duel (first of x).
      display - The display name of the arena to use.
    • endRound Link icon

      void endRound(@NotNull @NotNull org.bukkit.event.entity.PlayerDeathEvent event)
      Ends the current round of the duel and proceeds to the next round, or ends the duel if no rounds remain.
      Parameters:
      event - The PlayerDeathEvent that ends the round.
    • end Link icon

      void end(@NotNull @NotNull org.bukkit.event.entity.PlayerDeathEvent event)
      Ends the duel after one player has been defeated.
      Parameters:
      event - The PlayerDeathEvent that ends the duel.
    • leave Link icon

      void leave(@NotNull @NotNull org.bukkit.entity.Player player)
      Allows a player to leave the duel, either by quitting or being forcibly removed.
      Parameters:
      player - The player who is leaving the duel.
    • forceClose Link icon

      void forceClose()
      Forces the closing of all ongoing duels.
    • spectate Link icon

      void spectate(@NotNull @NotNull org.bukkit.entity.Player spectator, @NotNull @NotNull org.bukkit.entity.Player player)
      Allows a player to spectate an ongoing duel.
      Parameters:
      spectator - The player who wants to spectate.
      player - The player involved in the duel that the spectator wants to watch.
    • leaveSpectating Link icon

      void leaveSpectating(@NotNull @NotNull org.bukkit.entity.Player spectator, boolean messages)
      Allows a spectator to leave the duel they are spectating.
      Parameters:
      spectator - The spectator who is leaving.
      messages - Whether or not to send messages to the spectator when they leave.
    • inDuel Link icon

      boolean inDuel(@NotNull @NotNull org.bukkit.entity.Player player)
      Checks if a player is currently in a duel.
      Parameters:
      player - The player to check.
      Returns:
      true if the player is in a duel, false otherwise.
    • isSpectating Link icon

      boolean isSpectating(@NotNull @NotNull org.bukkit.entity.Player player)
      Checks if a player is currently spectating a duel.
      Parameters:
      player - The player to check.
      Returns:
      true if the player is spectating, false otherwise.
    • remove Link icon

      void remove(@NotNull @NotNull org.bukkit.entity.Player player)
      Removes a player from all duel-related data, including their session, teams, and other information.
      Parameters:
      player - The player to remove from the duel.
    • getActiveDuels Link icon

      @Contract(pure=true) @NotNull @NotNull @UnmodifiableView Map<UUID,DuelSession> getActiveDuels()
      Gets all active duel sessions.
      Returns:
      A map of active duel sessions with player UUIDs as keys and duel session objects as values.