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:
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.
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.
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
JavaDocs
Nexus API provides JavaDocs for all the classes and methods. You can find the JavaDocs for Nexus API here.