API for other plugins
Eranio Published on: 19. October 2026
Achievements (Hytale): API for other plugins
Other plugins on the same server can read achievement data at runtime by reflection, without a compile time dependency on this plugin. Class: de.eranio.achievements.hytale.api.AchievementsApi. All methods are static, only use Java standard types and never throw an exception. Without Achievements running, every method returns an empty result instead of failing.
Class<?> api = Class.forName("de.eranio.achievements.hytale.api.AchievementsApi");
List<?> players = (List<?>) api.getMethod("players", int.class, int.class).invoke(null, 20, 0);
Times are returned as milliseconds since 1970 (UTC). gameKey() always returns default.
Methods
| Method | Returns |
|---|---|
int apiVersion() |
API version, currently 1 |
String pluginVersion() |
Installed plugin version, for example 1.0.3 |
String gameKey() |
Always default |
List<Map<String, Object>> categories() |
One entry per category: id, icon, name_de, name_en, total |
List<Map<String, Object>> achievements() |
One entry per achievement: id, category, tier, hidden, goal, scope, name_de, name_en, desc_de, desc_en, unlockedCount |
List<Map<String, Object>> players(int limit, int offset) |
One entry per player: uuid, name, unlocked, total (tier weighted points), lastSeen, playtimeSeconds. Limit is clamped between 1 and 500 |
Map<String, Object> player(String uuidOrName) |
uuid, name, playtimeSeconds, activeTitle, unlocked (list of id, unlockedAt), progress (list of id, current, goal) |
List<Map<String, Object>> recentUnlocks(int limit) |
One entry per recent unlock: player, achievement, at. Limit is clamped between 1 and 200 |
List<Map<String, Object>> serverFirsts() |
One entry per server first: achievement, uuid, name, at |
boolean grant(String player, String achievementId) |
Unlocks an achievement for an online player, returns whether it succeeded |
boolean revoke(String player, String achievementId) |
Removes an achievement from an online player, returns whether it succeeded |
player() and players() accept either a player name or a UUID. No permission checks are performed by the API itself, that is left to the calling plugin.