The public API for Phoenix, pxQueue and pxCosmetics.
This artifact contains interfaces and stubs only — every method throws until the real plugin is installed, so
always depend on it with provided scope and never shade it into your jar.
Add our repository to your pom.xml:
<repositories> <repository> <id>refine-public</id> <url>https://maven.refinedev.org/public-repo/</url> </repository> </repositories>
Then add the dependency:
<dependency> <groupId>xyz.refinedev.phoenix</groupId> <artifactId>pxAPI</artifactId> <version>3.0</version> <scope>provided</scope> </dependency>
Building needs JDK 17 or newer, because the Velocity API cannot be read by JDK 8. The jar itself still targets Java 8.
git clone https://github.com/RefineDevelopment/Phoenix-API.git
cd Phoenix-API
mvn clean install
On Bukkit, Phoenix is the entry point to everything:
Phoenix phoenix = Phoenix.getInstance();
For code that also has to run on Bungee or Velocity, use CommonPlatform, which exposes every handler that is
shared across the three platforms:
CommonPlatform platform = PlatformGetter.getInstance();
pxQueue and pxCosmetics have their own entry points:
QueueAPI queueApi = QueueAPI.INSTANCE; pxCosmetics cosmetics = pxCosmetics.getInstance();
CommonPlatform gives you the cross-platform handlers, including:
| Handler | What it covers |
|---|---|
IProfileHandler |
Player profiles |
IRankHandler |
Ranks and scopes |
IGrantHandler |
Rank grants |
IPunishmentHandler, IPunishmentLadderHandler |
Punishments and ladders |
IReportHandler, IReportCategoryHandler |
Reports |
IAltHandler, IAddressStatsHandler |
Alt detection and address stats |
IServerHopHandler |
Server hopping |
ITagHandler, ICustomTagHandler |
Tags |
INetworkHandler, IWhitelistHandler |
Servers and whitelisting |
IChatLogHandler, IChatSnapshotHandler, ICommandLogHandler |
Logging |
ISecurityHandler, ILoginHandler |
Staff security and logins |
IAnalyticsHandler, IMetricsHandler |
Analytics and metrics |
IAntiVPNHandler, IFilterHandler |
Anti-VPN and chat filters |
ICooldownHandler, INotificationHandler, IPlaceholderHandler, IDatabaseHandler, IHashHandler |
Misc |
Phoenix adds the Bukkit-only handlers on top: ChatHandler, DisguiseHandler, VisibilityHandler,
AuthHandler, RebootHandler, HookHandler, AfkHandler, AnomalyHandler, BanWaveHandler, FreezeHandler,
PanicHandler, VanishHandler, WaypointHandler, ConfigSyncHandler, BukkitLocaleHandler, MenuHandler,
MenuTitleHandler, PhoenixCommandHandler and PhoenixTimeoutManager.
Getting a player's highest rank:
Phoenix phoenix = Phoenix.getInstance(); IProfile profile = phoenix.getProfileHandler().getProfile(player.getUniqueId()); if (profile != null) { player.sendMessage(profile.getName() + "'s highest rank is " + profile.getHighestRank().getName()); }
Listing a player's punishments:
List<IPunishment> punishments = Phoenix.getInstance().getPunishmentHandler().getPunishments(uuid); player.sendMessage("That player has " + punishments.size() + " punishments.");
Checking whether a player is queued:
Queue queue = QueueAPI.INSTANCE.getPlayerQueue(uuid); if (queue != null) { player.sendMessage("Player is currently queued for " + queue.getName()); } else { player.sendMessage("Player is currently not in a queue"); }
Phoenix fires its own Bukkit events, which you listen to as usual:
- Profiles:
ProfileNetworkJoinEvent,ProfileNetworkLeaveEvent,ProfileSettingUpdateEvent - Ranks:
ProfileGrantEvent,ProfileGrantRevokeEvent - Punishments:
ProfilePunishmentEvent,ProfilePunishmentRevokeEvent - Disguises:
ProfileDisguiseEvent,ProfileUndisguiseEvent - Staff:
PlayerFreezeEvent,PlayerUnFreezeEvent,PlayerVanishUpdateEvent,PlayerModModeUpdateEvent,PlayerReportEvent - Chat:
PlayerChatInChannelEvent
@EventHandler public void onGrant(ProfileGrantEvent event) { IGrant grant = event.getGrant(); Bukkit.broadcastMessage(event.getProfile().getName() + " was granted " + grant.getRank().getName()); }
Questions and bug reports: dsc.gg/refine