DEVELOPER 🌐 API

📡 Events

On this page, you will find every event the Phoenix Lobby API fires.

#Events

Four events are fired, and all of them are ordinary Bukkit events, so a normal listener picks them up. They live in com.phoenixplugins.phoenixlobby.api.events.

Event Fired when
PlayerDoubleJumpEvent A player uses the double jump
PlayerParkourStartEvent A player starts a parkour run
PlayerParkourJumpEvent A player lands on the next parkour block
PlayerParkourEndEvent A parkour run ends

#What each one carries

Event Available on the event Cancellable
PlayerDoubleJumpEvent getPlayer() Yes
PlayerParkourStartEvent getPlayer(), getParkourIdentifier() Yes
PlayerParkourJumpEvent getPlayer(), getParkourIdentifier(), getScore() No
PlayerParkourEndEvent getPlayer(), getParkourIdentifier(), getScore(), getElapsedSeconds(), isNewRecord() No

Cancelling PlayerDoubleJumpEvent stops the launch, and cancelling PlayerParkourStartEvent stops the run before it begins — which is how another plugin blocks either one in its own regions or during its own events.

@EventHandler
public void onDoubleJump(PlayerDoubleJumpEvent event) {
    if (isInMyArena(event.getPlayer())) {
        event.setCancelled(true);
    }
}
public class ParkourListener implements Listener {

    @EventHandler
    public void onParkourEnd(PlayerParkourEndEvent event) {
        if (!event.isNewRecord()) {
            return;
        }

        Bukkit.broadcastMessage(event.getPlayer().getName()
                + " set a new record on " + event.getParkourIdentifier()
                + " with " + event.getScore() + " points.");
    }
}

circle-info

The parkour identifier is the one you gave the parkour in the editor, the same string the parkour placeholders take.

Setting your listener up, and the rest of what the plugin exposes, is on the API page.

Last updated 27 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