Nexus API
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 Required
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.bx-team.space/releases") }
maven { url "https://repo.bx-team.space/releases" }
<repository>
<id>bx-team-releases</id>
<name>BX Team Maven repository</name>
<url>https://repo.bx-team.space/releases</url>
</repository>
2
3
4
5
implementation("space.bxteam:nexus:0.2")
implementation "space.bxteam:nexus:0.2"
<dependency>
<groupId>space.bxteam</groupId>
<artifactId>nexus</artifactId>
<version>0.2</version>
</dependency>
2
3
4
5
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]
dependencies:
server:
Nexus:
load: BEFORE
required: true
join-classpath: true
2
3
4
5
6
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:
Class | Provide method |
---|---|
ChatService | getChatService() |
HomeService | getHomeService() |
JailService | getJailService() |
RandomTeleportService | getRandomTeleportService() |
SpawnService | getSpawnService() |
TeleportService | getTeleportService() |
TeleportRequestService | getTeleportRequestService() |
WarpService | getWarpService() |
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();
}
}
2
3
4
5
6
7
8
9
10
11
JavaDocs
Nexus API provides JavaDocs for all the classes and methods. You can find the JavaDocs for Nexus API here.