Oops... looks like the spiders padded through here
Add products to your cart and remove them from here Lets buyOn this page, you will find everything you need to know about our API.
Build your own extensions for Phoenix Lobby with our public API.
<repositories>
<repository>
<id>phoenixplugins</id>
<url>https://repo.phoenixplugins.com/</url>
</repository>
</repositories>
<dependency>
<groupId>com.phoenixplugins.phoenixlobby</groupId>
<artifactId>api</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
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.
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.
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.
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.
Oops... looks like the spiders padded through here
Add products to your cart and remove them from here Lets buy