API Reference
API Reference
Section titled “API Reference”KS Nameplates provides a public API for cross-mod integration via NameplatesAPI.
Availability Check
Section titled “Availability Check”if (NameplatesAPI.isAvailable()) { NameplatesAPI api = NameplatesAPI.getInstance(); // Use API}Tag Management
Section titled “Tag Management”Get Tags
Section titled “Get Tags”// Get a specific tag by IDTag tag = api.getTag("vip");
// Get all tagsCollection<Tag> allTags = api.getAllTags();
// Get a groupTagGroup group = api.getGroup("ranks");
// Get all groupsCollection<TagGroup> allGroups = api.getAllGroups();Player Tags
Section titled “Player Tags”UUID playerUuid = player.getUuid();
// Activate a tag for a playerapi.activateTag(playerUuid, "vip");
// Deactivate a tagapi.deactivateTag(playerUuid, "vip");
// Clear all tagsapi.clearTags(playerUuid);
// Get active tag IDsSet<String> active = api.getActiveTags(playerUuid);
// Get active tags sorted by priorityList<Tag> sorted = api.getActiveTagsSorted(playerUuid);Nameplate Text
Section titled “Nameplate Text”// Get the formatted nameplate text for a playerString text = api.getNameplateText(playerUuid, "PlayerName");// Returns e.g., "[VIP] [Builder] PlayerName"Admin Operations
Section titled “Admin Operations”// Create or update a tagTag newTag = new Tag("event_2026", "[Event]", "#FF44FF", "nameplates.tag.event", "events", TagType.PREFIX, 50, false);api.addTag(newTag);
// Remove a tagapi.removeTag("event_2026");
// Manage groupsapi.addGroup(new TagGroup("events", "Event Tags", 5, false));api.removeGroup("events");
// Refresh all nameplatesapi.refreshAll();Tag Data Model
Section titled “Tag Data Model”public class Tag { String id; // Unique identifier String displayText; // Display text (e.g., "[VIP]") String chatColor; // Hex color (e.g., "#FFD700") String permission; // Permission node (null = no restriction) String groupId; // Group ID TagType type; // PREFIX, SUFFIX, or ABOVE int priority; // Sort order (lower = first) boolean defaultActive; // Auto-activate on permission String imagePath; // PNG path for image tags (optional)}