Skip to content
github-actions[bot] edited this page Jan 24, 2025 · 1 revision

API

The LoriTime API offers various methods for querying and managing the online times of players.

Compatibility

Plattform Version Supported
paper 1.7.0 - current
Folia 1.7.0 - current
velocity 1.7.0 - current
bungee 1.7.0 - current

API Introduction

Note: There is currently no Maven or Gradle repo! This could be added in the future if it's really necessary.

1. Adding LoriTime as a dependency
name: MyPlugin
version: 1.0
main: myplugin.MyPlugin
author: MaxMustermann
description: 'A plugin that hooks with the LoriTime API!'
softdepend: # or 'depend'
  - LoriTime
2. Creating a class to do stuff with LoriTime
public class LoriTimeAPIHook {
  
    public LoriTimeAPIHook() {
        // Ready to do stuff with the API
    }

}
3. Instancing the plugin Hook
public class MyPlugin extends JavaPlugin {
    private LoriTimeAPIHook loriTimeHook;

    @Override
    public void onEnable() {
        if (Bukkit.getPluginManager().getPlugin("LoriTime") != null) {
            this.loriTimeHook = new LoriTimeAPIHook();
        }
    }
}
  • You can now get the API instance by calling LoriTimeAPI#get()
Clone this wiki locally