AuroraCollections
  • AuroraCollections
  • Configuration
    • Main configuration
    • Category configuration
    • Collection configuration
    • Menu configuration
      • Categories (main menu)
      • Category rewards
      • Collection list
      • Collection progression
  • Commands
  • Rewards
  • Permissions
  • Placeholders
  • API
  • Compatible plugins
Powered by GitBook
On this page
  • Add the API to your project
  • Maven
  • Gradle (Groovy)
  • Gradle (Kotlin)
  • Get the API instance
  • Progressing collections

API

Developer API Guide

The API allows developers to access registered collections and to progress collections for players. You can also register Custom reward types and reward auto-correctors.

Add the API to your project

Maven

If you are insist on using maven still for whatever reason, you might need to include Aikars ACF repo as well.

pom.xml
<repository>
    <id>auroramc</id>
    <url>https://repo.auroramc.gg/releases/</url>
</repository>
pom.xml
<dependency>
    <groupId>gg.auroramc</groupId>
    <artifactId>AuroraCollections</artifactId>
    <version>1.5.1</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>gg.auroramc</groupId>
    <artifactId>Aurora</artifactId>
    <version>2.1.6</version>
    <scope>provided</scope>
</dependency>

Gradle (Groovy)

build.gradle
repositories {
    maven {
        url "https://repo.auroramc.gg/releases/"
    }
}

dependencies {
    compileOnly 'gg.auroramc:Aurora:2.1.6'
    compileOnly 'gg.auroramc:AuroraCollections:1.5.1'
}

Gradle (Kotlin)

build.gradle.kts
repositories { 
    maven("https://repo.auroramc.gg/releases/")
}

dependencies { 
    compileOnly("gg.auroramc:Aurora:2.1.6")
    compileOnly("gg.auroramc:AuroraCollections:1.5.1")
}

Get the API instance

import gg.auroramc.collections.api.AuroraCollectionsProvider;
import gg.auroramc.collections.collection.CollectionManager;

CollectionManager manager = AuroraCollectionsProvider.getCollectionManager()

Progressing collections

This will progress all collections with the block_loottrigger with the given item.

ItemStack myItem = ...;
TypeId typeId = AuroraAPI.getItemManager().resolveId(myItem);
int amount = myItem.getAmount();

manager.progressCollections(player, typeId, amount, Trigger.BLOCK_LOOT);
PreviousPlaceholdersNextCompatible plugins

Last updated 3 months ago

You can view how to add Custom rewards and correctors for them . Though you will need to register them through the CollectionManager.

here