Developer API

Here you can view how to access the Night Market API and how to use the developer API.

Java Docs

Here you can view the Java Docs here for Night Market which provides you all the usages and descriptions of the API.

Maven Repository

Do you want to integrate with Night Market in your plugin? You can use the OlzieDev repo to build against the Night Market API.

Under repositories in your pom.xml, you need to add a new repository for the repo.

<repositories>
    ...
    <repository>
        <id>olzie-repo</id>
        <url>https://repo.olziedev.com/</url>
    </repository>
</repositories>

Next, add Night Market as a dependency under dependencies:

VERSION_HERE would be your exact plugin version, you will not need to update the API version every time a plugin update is out, only when an api update happens.

<dependencies>
    ...
    <dependency>
        <groupId>com.olziedev</groupId>
        <artifactId>nightmarket-api</artifactId>
        <version>VERSION_HERE</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

How to access the API

You can access the Night Market API by getting the instance. If the plugin hasn't fully loaded the instance will return null, you can use a callback to access the API when its ready.

/* 
Accessing the instance, can return null if not loaded.

This instance can also change when a plugin reload has 
happened, so its not advisted to use this
*/ 
NightMarketAPI api = NightMarketAPI.getInstance(); 

NightMarketAPI.getInstance(api -> { // accessing the instance when its ready.

});

Some examples

Last updated