Skip to content

Developers API

Berke Akçen edited this page Jan 22, 2022 · 27 revisions

Table of contents

Using King of the Ladder API

The project isn't in the Central Repository yet, so specifying a repository is needed.
To add this project as a dependency to your project, add the following to your pom.xml:

Maven Dependency

<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>
<dependency>
    <groupId>com.github.Despical</groupId>
    <artifactId>KOTL</artifactId>
    <version>2.0.0</version>
    <scope>compile</scope>
</dependency>

Gradle Dependency

repositories {
    maven { url 'https://jitpack.io' }
}
dependencies {
    compileOnly group: "com.github.Despical", name: "KOTL", version: "2.0.0";
}

Player Statistic Change Event

This event calls when user's any statistic change.

Example Usage

@EventHandler
public void onStatChange(KOTLPlayerStatisticChangeEvent event) {
    StatsStorage.StatisticType stat = event.getStatisticType();
    int value = event.getNumber();

    event.getPlayer().sendMessage("Updated statistic name: " + stat.name() + " , Updated value: " + value);
}

Statistic Types

Enum Name Statistic ID Persistent Description
TOURS_PLAYED toursplayed true Played tours
amounts
SCORE score true Total score
amount
Clone this wiki locally