Your cart is empty
Looks like the spiders padded through here. Pick a plugin and it will show up here. Continue shoppingWrite Java add-ons that react to matches, kills, deaths, queues, parties and elo changes, or stop a match before it starts. The API is only available in Phoenix Duels Premium.
Maven, exactly as documented on API:
<repositories>
<repository>
<id>phoenixplugins</id>
<url>https://repo.phoenixplugins.com/</url>
</repository>
</repositories>
<dependency>
<groupId>com.phoenixplugins.phoenixduels</groupId>
<artifactId>api</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
The docs only show Maven snippets; no Gradle snippet is documented yet. Dependency details: see API.
Create an addon.yml file in your project resources folder.
name: AddonName
main: your.path.AddonExample
author: [YourName]
version: 1.0.0
description: Small description (optional)
website: https://your-website.com (optional)
Required fields:
name: Display name of your addon.main: Fully qualified path to your addon main class.author: One or more addon authors.version: Addon version.The main value in addon.yml must point to your class that extends Addon.
package your.path;
import com.phoenixplugins.phoenixduels.api.sdk.plugin.addons.Addon;
public class AddonExample extends Addon {
@Override
public void init() {
// Register rules, menus, modules, or listeners.
}
@Override
public void load() {
// Runtime registrations and startup logic.
}
@Override
public void unload() {
// Cleanup logic.
}
@Override
public void reload() {
// Optional runtime reload logic.
}
@Override
public String getRequiredPluginVersion() {
return "1.0.0";
}
}
plugins/PhoenixDuels/addons.Source: Custom Addons.
22 documented events, from Events. All are Bukkit events, listened to with @EventHandler.
| Event | Fires when | Cancellable | Reference |
|---|---|---|---|
MatchCreateEvent |
A match object has been built but no players have been moved yet. Cancelling stops the match from ever running. | Yes | Docs · Javadoc |
MatchPreStartEvent |
Just before players are teleported in, while every start requirement is being checked. See the note below on cancelling with a reason. | Yes | Docs · Javadoc |
MatchStartEvent |
The match is about to begin. | Yes | Docs · Javadoc |
MatchPhaseStartEvent |
The match moves from one state to another. Exposes getOldState() and getNewState(). | No | Docs · Javadoc |
MatchPreEndEvent |
The match has been decided but has not been cleaned up yet, so match data is still readable. | No | Docs · Javadoc |
MatchEndEvent |
The match is over. getConnectedPlayers() returns everyone still online at that point. | No | Docs · Javadoc |
MatchPlayerKillEvent |
A player kills someone. getVictim() returns who died. | No | Docs · Javadoc |
MatchPlayerDeathEvent |
A player dies. getKiller() may be null. setDeathMessage(String[]) replaces the broadcast with your own text. | No | Docs · Javadoc |
MatchPlayerLeaveEvent |
A player leaves the match. isGuest() tells you whether they were a spectator rather than a participant. | No | Docs · Javadoc |
MatchSpectatorJoinEvent |
Someone starts spectating the match. | No | Docs · Javadoc |
MatchSpectatorLeaveEvent |
Someone stops spectating the match. | No | Docs · Javadoc |
MatchPlayerChangeEloEvent |
A match changes a player's rating in one mode. Exposes getPlayer(), getOldElo(), getNewElo() and getMatch(). | No | Docs · Javadoc |
PlayerGlobalEloChangeEvent |
A player's global elo changes, including through the admin commands. Exposes getPlayer(), getOldElo() and getNewElo(). | No | Docs · Javadoc |
ProfileQueueStartEvent |
A player or party enters the matchmaking queue. | No | Docs · Javadoc |
ProfileQueueStopEvent |
A player or party leaves it, whether by finding a match or by cancelling. | No | Docs · Javadoc |
PartyCreatedEvent |
A party is created. | No | Docs · Javadoc |
PartyDisbandEvent |
A party is disbanded. Carries the list of participants it had. | No | Docs · Javadoc |
PartyParticipantAddedEvent |
A participant joins the party. Exposes getParticipant(). | No | Docs · Javadoc |
PartyParticipantAcceptedEvent |
A participant accepts their invitation. Exposes getParticipant(). | No | Docs · Javadoc |
PartyParticipantRemovedEvent |
A participant leaves or is kicked. Exposes getParticipant(). | No | Docs · Javadoc |
PartyLeaderChangedEvent |
Leadership passes to someone else. Exposes getOldLeaderUniqueId() and getNewLeaderUniqueId(). | No | Docs · Javadoc |
RematchWindowEvent |
A rematch window opens for a player at the end of a match. Exposes getPlayer() and getDurationSeconds(). Requires the Rematch & Requeue add-on. | No | Docs · Javadoc |
Also in the javadoc, not yet described in the docs:
MatchProfileEvent.
Track match start and phase transitions, verbatim from Examples:
import com.phoenixplugins.phoenixduels.api.events.MatchPhaseStartEvent;
import com.phoenixplugins.phoenixduels.api.events.MatchStartEvent;
import com.phoenixplugins.phoenixduels.api.match.MatchState;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
public final class MatchLifecycleListener implements Listener {
@EventHandler
public void onStart(MatchStartEvent event) {
if (event.getMatch().getTeamsPlayers().isEmpty()) {
event.setCancelled(true);
}
}
@EventHandler
public void onPhase(MatchPhaseStartEvent event) {
if (event.getNewState() == MatchState.ROUND_IN_PROGRESS) {
// Start your per-round metrics.
}
}
}
Register your listener through plugin entrypoint, from Examples:
import com.phoenixplugins.phoenixduels.api.PhoenixDuelsAPI;
import org.bukkit.event.Listener;
public final class ListenerBootstrap {
public void register(Listener listener) {
PhoenixDuelsAPI.getPluginInstance().getEventBus().registerListener(listener);
}
}
More examples: Examples.
For offline reading, scripts and tools, all Phoenix Duels docs are available as one text file. Any docs page can be read as plain markdown by adding .md to its URL.
Your cart is empty
Looks like the spiders padded through here. Pick a plugin and it will show up here. Continue shopping