Developer API

If you're looking for additional functionality from the Developer API, you can open a ticket in our Discord Server or send an email to support@insurgencedev.org to make a request.

PlayerCache

Simple API for getting players cached data

 

You can get the cache of player in a few ways not shown bellow, use DragonTagsAPI.# to see its options.

  
  public class Example extends JavaPlugin {

    public void onEnable() {
     String tagName = DragonTagsAPI.getPlayerCache(Insert_UUID_Here).tagName
     String categoryName = DragonTagsAPI.getPlayerCache(Insert_UUID_Here).tagCategory
     boolean randomTag = DragonTagsAPI.getPlayerCache(Insert_UUID_Here).randomTag
    }

    public void onDisable() {
        
    }
    
  }

 

Getting The Category Manager

To get the category manager is fairly simple

DragonTagsAPI.category.getCategoryManager().#

It has multiple methods to get and register categories using that will also allow you to get the tags each category holds

Example Usage: 

Getting all tags from all categories

Java Example

Map<String, TagCategory> categories = DragonTagsAPI.category.getCategoryManager().categories;
List<Tag> allTags = new ArrayList<>();
for (TagCategory category : categories.values()) {
    allTags.addAll(category.getTags());
}

Kotlin Example

val allTags = DragonTagsAPI.category.getCategoryManager().categories.flatMap { it.value.tags }