# API Usage

You can access the API from: <https://github.com/WaterArchery/LitTournaments>

{% hint style="warning" %}
Always check the latest version of the API before importing.
{% endhint %}

## Maven Repository

```
<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>
```

## Dependency

```
<dependency>
    <groupId>com.github.WaterArchery</groupId>
    <artifactId>LitTournaments</artifactId>
    <version>1.0.3</version>
    <scope>provided</scope>
</dependency>
```

## How to access LitTournamentsAPI instance?

```java
LitTournamentsAPI api = LitTournamentsAPI.getInstance();

// Get the tournaments that uses this objective
List<Tournament> tournaments = api.getTournamentHandler().getTournaments(BlockBreakTournament.class);
        
// Or you can get a tournament with a id
// Argumant is the name of the yml file
Tournament tournament = api.getTournamentHandler().getTournament("blockBreak");

// It will return null, if there is no tournament with that id.
if (tournament == null) return; 
        
// Add points to player
api.getPointHandler().addPoint(UUID.randomUUID(), tournament, 10);
```


---

# Agent Instructions: 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:

```
GET https://waterarchery.gitbook.io/littournaments-wiki/api/api-usage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
