NovaFFA

Developer API

The entry point, accessors and events another plugin uses to hook into NovaFFA

NovaFFA ships its own small API for another plugin to read state or react to what happens in a fight. Add NovaFFA as a dependency, soft or hard, and call FFAAPI.api().

Entry point

import cc.arrowtan.novaffa.api.FFAAPI;

FFAAPI api = FFAAPI.api();
MethodReturns
arenas()Every arena that exists
arena(String name)One arena by name, or null
arenaOf(Player player)The arena a player is currently in, or null
kits()Every kit that exists
kit(String name)One kit by name, or null
data(UUID uuid)That player's stats, creating a record if none exists yet

Events

NovaFFA's events are not standard Bukkit events, they do not go through @EventHandler. Register a listener through api.listeners() instead:

api.listeners().register(FFAEnterEvent.class, event -> {
    // handle it
});
EventFiresEffect of disallowing / cancelling / hiding
FFAEnterEventOnce a player has landed in an arena and been handed their kitNothing, informational only
FFALeaveEventBefore a player is moved out of an arenaCancelling keeps them where they are
FFACombatTagEventJust before a player is put in combat, on every hitDisallowing leaves them free to walk away
FFABlockedCommandEventWhen a blocked command is caughtAllowing lets the command through, blocked unless a listener says otherwise
KitEditorListEventFor each kit as the layout editor list is builtHiding leaves that kit off the list for that player

Every event exposes player() and playerData(). FFAEnterEvent and FFALeaveEvent also expose arena(), kit() and layout(). FFACombatTagEvent exposes attacker(), millis() and refresh(), see Combat Tag.

A listener that throws does not take the rest of the plugin down with it, the exception is caught and logged.

Coverage

Arena regeneration, kit creation and menu clicks are not currently events, only the paths above fire one.

On this page