Sueta
UL

UltraAFK API║1.8/1.16.2║The Most Annoying AFK API System for

1.1

⭐✅The Best AFK API System!✅ ║✯Supported MultiWorld & BungeeCord!✯║⭐

·Plugin

Simple Jar File Cleaned only with the API for my plugin UltraAFK.

For use this api requires UltraAFK 9.8 D Version.

Requested by @AlonsoAliaga

( FOR INSTALL THIS API TO YOU PROJECT YOU ONLY NEED TO ADD THIS FILE TO YOUR PLUGIN LIBRARIES. )

Call the API:

UltraAFKAPI instance = UltraAFKAPI.getAPI();

Check if player is AFK

boolean isAFK = instance.isPlayerAFK(Player);

Check Player Files/YamlConfigurations, for get plugin data.

File file = instance.getPlayerFile(Player);
YamlConfiguration configuration = instance.getConfigFile(Player);

Check if server is using UltraAFK as BungeeCord or MultiWorld Server

boolean mode = instance.isBungeeCordServer();
boolean mode = instance.isMultiWorldServer();

Getting ServerMode and AFKMode

Modes serverMode = instance.getServerMode();
AFKModes afkMode = instance.getAFKMode();
Enums
// Modes Enum:
MULTIWORLD, AFKZONE, LOBBY

//AFKModes Enum:
SINGULAR, PERPERMISSIONS

Get the Current time of a Player

// if Player is AFK it will returns the time that the player has as afk.
// if Player is not AFK it will returns the time that plugin has checked the player as "inactive" if player is being detected as "active" it will returns 0

int time = instance.getTimeOfPlayer(Player);

Get AFK Detection Delay of a Player

// Returns the time that is setted in config.yml, in this case, the afk detection delay. This includes if mode is PerPermissions or Singular.

int afkTime = getAFKTimeOfPlayer(Player);

Get AFKZone Locations

//Returns a list of locations, depending if server has more than one location

List<Location> locations = instance.getAFKZoneLocations();

Similar projects

Plugin →