DEVELOPER

🌐 API

On this page, you will find everything you need to know about our API.

#API

Build your own extensions for Phoenix Lobby with our public API.

#Maven Repository

<repositories>
    <repository>
        <id>phoenixplugins</id>
        <url>https://repo.phoenixplugins.com/</url>
    </repository>
</repositories>

#Dependency

<dependency>
    <groupId>com.phoenixplugins.phoenixlobby</groupId>
    <artifactId>api</artifactId>
    <version>1.0.0-SNAPSHOT</version>
</dependency>

#Getting started

Add PhoenixLobby to your plugin.yml so your plugin loads after it.

depend: [PhoenixLobby]

Use softdepend instead if your plugin should still work when PhoenixLobby is not installed. In that case check PhoenixLobbyAPI.isAvailable() before calling anything.

#The API class

PhoenixLobbyAPI answers questions about the lobby without going through placeholders.

if (!PhoenixLobbyAPI.isAvailable()) {
    return;
}

PhoenixLobbyAPI api = PhoenixLobbyAPI.get();
Method Returns
getVersion() The version of PhoenixLobby that is running
getNpcTypes() Every NPC configured on this server
getNpcType(String identifier) One NPC by its identifier, as an Optional
isLobbyWorld(String worldName) Whether the plugin treats that world as a lobby
isInPvpMode(Player player) Whether the player is in PvP mode
getPlayingParkour(Player player) The parkour the player is running, as an Optional
getParkourHighScore(Player, String) That player's best score on a parkour
PhoenixLobbyAPI.get().getPlayingParkour(player).ifPresent(parkour -> {
    player.sendMessage("You are running " + parkour + ".");
});

An NpcType gives you isEnabled(), getIdentifier(), getDisplayName() and getEngineData(), which in turn reports the engine that NPC is drawn with.

circle-exclamation

PhoenixLobbyAPI.get() throws if the plugin has not finished loading. Call it from inside your own onEnable or later, never from a static initialiser, and guard it with isAvailable() when PhoenixLobby is only a soft dependency.

#Everything else

Anything not documented here is internal and can change between versions. For values rather than behaviour, the placeholders are the stable route and cover far more of the plugin than the API does.

#Guides

Last updated 28 minutes ago
My Cart (0 items)

Oops... looks like the spiders padded through here

Add products to your cart and remove them from here Lets buy