> For the complete documentation index, see [llms.txt](https://ctf-docs.juriantech.nl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ctf-docs.juriantech.nl/api.md).

# API

Here is a possible TNT-Tag API page:

## CaptureTheFlag API

To use the CaptureTheFlag API, call CaptureTheFlag`.getAPI()`, which returns an instance of the `API` class. The `API` class provides the following methods:

### Methods

#### `int getWins(UUID playerUUID)`

Returns the number of times the specified player has won a game.

#### `void setWins(UUID playerUUID, int value)`

Sets the number of times the specified player has won a game.

#### `boolean arenaExists(String arenaName)`

Returns true if the specified arena exists.

#### `HashMap<Player, PlayerType> getPlayers(String arenaName)`

Returns a map of the players in the specified arena and their types (TNT or player).

#### `String getArenaState(String arenaName)`

Returns the current state of the specified arena (WAITING, STARTING, RUNNING, or ENDING).

#### `TreeMap<UUID, Integer> getWinsData()`

Returns a map of the UUIDs of all players and their corresponding number of wins.\
\
\&#xNAN;**`TreeMap<UUID, Integer> getWinstreakData()`**

Returns a map of the UUIDs of all players and their corresponding winstreak.

### Events

The following events are available:

#### `ArenaEndingEvent`

**Methods**

* `String getArenaName()`: Returns the name of the arena that is ending.
* `HashMap<Player, PlayerType> getPlayers()`: Returns a map of the players in the arena and their types.
* `ArrayList<Player> getWinners()`: Returns a list of the players who won the game.

#### `ArenaStartedEvent`

**Methods**

* `String getArenaName()`: Returns the name of the arena that has started.

#### `ArenaStartingEvent`

**Methods**

* `String getArenaName()`: Returns the name of the arena that is starting.

#### `PlayerJoinArenaEvent`

**Methods**

* `Player getPlayer()`: Returns the player who joined the arena.
* `String getArenaName()`: Returns the name of the arena the player joined.

#### `PlayerLeaveArenaEvent`

**Methods**

* `Player getPlayer()`: Returns the player who left the arena.
* `String getArenaName()`: Returns the name of the arena the player left.

#### `PlayerLostRoundEvent`

**Methods**

* `Player getPlayer()`: Returns the player who lost the round.
* `String getArenaName()`: Returns the name of the arena where the player lost.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ctf-docs.juriantech.nl/api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
