LeaderHeads API

When hooking into LeaderHeads, make sure to add it as a softdepend in your plugin.yml and check if it's available and enabled.

Download the API for development here.

Check if the plugin is available:

Plugin leaderheads = Bukkit.getPluginManager().getPlugin("LeaderHeads");
if(leaderheads != null) {
    //Do stuff
}

Use the supplied methods in the me.robin.leaderheads.api.LeaderHeadsAPI class.

Creating custom statistics

To create a custom statistic for players, it is recommended to use an Online DataCollector.

For more complicated uses, check out DataCollector.

Getting data

The following methods in me.robin.leaderheads.api.LeaderHeadsAPI class the allow you to get data: This returns an ordered list with name as key and score as value. It can return null if no data is found.

public static List<Entry<String, String>> getAllTimeTop(String type) {
public static List<Entry<String, String>> getDailyTop(String type) {
public static List<Entry<String, String>> getWeeklyTop(String type) {
public static List<Entry<String, String>> getMonthlyTop(String type) {
public static List<Entry<String, String>> getCustomTop(String type, String identifier) {

This returns an entry with name as key and score as value. It can return null if no data is found.