St3ix Docs
Advanced

Advanced

Call AFKPlus from another Paper plugin through Bukkit's ServicesManager.

AFKPlus registers me.st3ix.afkplus.api.AfkPlusApi when it enables and removes it when it disables. Your plugin should depend or softdepend on AFKPlus. Load the service after AFKPlus has enabled:

AfkPlusApi api = Bukkit.getServicesManager().load(AfkPlusApi.class);
if (api == null) {
    return;
}

null means AFKPlus is missing or has already shut down. The API never sends chat, action bars, or titles. A false return means the change was rejected. Storage errors are printed by AFKPlus and come back as false, or as 0 for a balance read.

Shop offers, zone corners, and booster definitions are edited in the GUIs and in config.yml. They are not methods on this API.

The method list is on API. PlaceholderAPI reads the same numbers, but it cannot change them. That list is on Placeholders.

Suggestions

Soft-depend on AFKPlus if your plugin must boot alone, and check load for null on every call. Use pay for a silent transfer. Use /shards pay only when a player should see the confirm screen.