🛠ī¸Plugin API

Plugin's own api.

Getting started:

Currenty for plugin developement you'll have to own the plugin to use this plugin's api.

To begin, add the plugin's jar file to the build path of your project.

Events:

@EventHandler
public void onGameStartEvent(GameStartEvent event) {
    Game game = event.getGame();
}

Called when the game starts. You can get the game object and access all the necessary data from it.

@EventHandler
public void onGameEndEvent(GameEndEvent event) {
    Game game = event.getGame();
}

Called when the game ends. You can get the game object and access all the necessary data from it.

@EventHandler
public void onGameLoadEvent(GameLoadEvent event) {
    Game game = event.getGame();
    World world = event.getWorld();
}

Called when the game is loaded. Usually happens after the server is starting.

@EventHandler
public void onGameStateChangeEvent(GameStateChangeEvent event) {
    Game game = event.getGame();
    GameState pastGameState = event.getPastGameState();
    GameState newGameState = event.getNewGameState();
}

Called when any of the games changes game state.

@EventHandler
public void onPlayerJoinGameEvent(PlayerJoinGameEvent event) {
    Game game = event.getGame();
    Player player = event.getPlayer();
}

Called when the player joins the game.

@EventHandler
public void onPlayerLeaveGameEvent(PlayerLeaveGameEvent event) {
    Game game = event.getGame();
    Player player = event.getPlayer();
}

Called when the player joins the game.

Objects:

public interface Game {
    public void SetWaitingLocation(Location location);
    public void SetLobbyLocation(Location location);
    public void Load(World world);
    public Set<UUID> GetLobbyPlayers();
    public String GetName();
    public int GetStartingPlayers();
    public Map<UUID, PlayerData> GetPlayers();
    public Map<UUID, SpectatorData> GetSpectators();
    public GameState GetGameState();
    public Date GetServerStartDate();
    public Location GetSpawn();
    public Location GetLobby();
    public int GetRound();
    public boolean SaveGame();
    public void StartGame();
    public void SetScoreboardOnJoin(Player player);
    public String GetTimeDisplay();
    public void SetSpectator(Player player);
    public void SetSpectator(Player player, PlayerData data);
    public void EndGame(boolean hasFinishedNormally);
    public void UpdatePosition(Player player, PlayerData pd);
    public PlayerData GetPlayerData(UUID uuid);
    public void DisplayRules(Player player);
    public void broadcastMessage(String message);
    public void broadcastSound(Sound sound, float volume, float pitch);
    public void broadcastTitle(String title, String subtitle, int in, int duration, int out);
    public void broadcastToolbar(String tc);
    public boolean Join(Player player);
    public void Leave(Player player);
    public List<BowlingLane> getLanes();
    public void MovePosition(PlayerData pd);
}

Last updated