Skip to content

Developers API

Berke Akçen edited this page Jun 27, 2021 · 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>1.2.1</version>
    <scope>compile</scope>
</dependency>

Gradle Dependency

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

King of the Ladder Events

KOTLPlayerStatisticChangeEvent

This event calls when user's any statistic change.

Example

@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