Nexus API

Learn how to use the Nexus API in your plugins.


We provide a simple and easy to use API that allows you to create your own plugins using Nexus API. This page will show you how to use Nexus API in your project.

Dependency installation

To use Nexus API you need to add our repository and Nexus to your repositories and dependencies in your project.

Depending on the build system you are using, add the following code to your project:

maven { url = uri("https://repo.bxteam.org/releases") }
implementation("space.bxteam:nexus:0.4.0")

You must also add dependency inside plugin.yml or paper-plugin.yml file, this is required to load our plugin before your plugin, so they can access our API.

depend: [Nexus]

Using Nexus API

To use Nexus API in your project, you need to create an instance of NexusAPI class. This class provides all the methods you need to interact with Nexus. You can do this by using NexusAPIProvider.get() method.

NexusAPI nexusApi = NexusAPIProvider.get();

After creating instance of API, you can use all the methods that are available in Nexus API. This includes:

ClassProvide method
ChatServicegetChatService()
HomeServicegetHomeService()
JailServicegetJailService()
RandomTeleportServicegetRandomTeleportService()
SpawnServicegetSpawnService()
TeleportServicegetTeleportService()
TeleportRequestServicegetTeleportRequestService()
WarpServicegetWarpService()

Example usage of JailService

public class YourPlugin extends JavaPlugin {
 
    private NexusAPI nexusApi;
    private JailService jailService;
 
    @Override
    public onEnable() {
        this.nexusApi = NexusAPIProvider.get();
        this.jailService = nexusApi.getJailService();
    }
}

JavaDocs

Nexus API provides JavaDocs for all the classes and methods. You can find the JavaDocs for Nexus API here.

On this page