LitTournaments
  • 👋Welcome to LitTournaments Wiki
  • 💫Command And Permissions
    • 💡Player Commands And Permissions
    • 💪Admin Commands And Permissions
  • ⁉️Info
    • 📪Frequently Asked Questions
    • 📎Available Objectives
    • 🪧Available Placeholders
    • 🗣️Discord Server
  • 🗄️Files
    • 📁Example Tournament File
    • 📂config.yml
    • 📂lang-en.yml
  • 👨‍💻API
    • 📑API Usage
Powered by GitBook
On this page
  • Maven Repository
  • Dependency
  • How to access LitTournamentsAPI instance?
  1. API

API Usage

Previouslang-en.yml

Last updated 10 months ago

You can access the API from:

Always check the latest version of the API before importing.

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?

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);
👨‍💻
📑
https://github.com/WaterArchery/LitTournaments