serverManagers

🧭 Overview

ArenaLegends exposes several Manager classes that allow you to interact with the plugin's data and game instances. Most interactions start with GameManager, PlayerDataManager, or the NPCManager.

circle-info

Check the Javadocsarrow-up-right for reference.


🎮 Game Manager

Use GameManager (xericker.arenalegends.core.game.GameManager) to access game instances.

Method
Description
Example

getById(String id)

Get a game by its specific ID.

GameManager.getById("arena_1")

getRoot(String id)

Get the root template of a game.

GameManager.getRoot("arena_1")

getList()

Retrieve a queue of all active games.

GameManager.getList()


👤 Player Data Manager

Use PlayerDataManager (xericker.arenalegends.playerdata.manager.PlayerDataManager) to access persistent player profiles, which include settings, statistics, and cosmetics.

Fetching Data

import xericker.arenalegends.playerdata.instance.PlayerData;
import xericker.arenalegends.playerdata.manager.PlayerDataManager;

PlayerData data = PlayerDataManager.getInstance().get(player);
if (data != null) {
    // Access data here
}

🤖 NPC Manager

Use the NPCManager to interact with ArenaLegends' Citizens NPCs, such as the bots and dummies used in the plugin.

Accessing the Manager

You can access the NPCManager via the GameHandler singleton:

From here, you can manage the NPCRegistry provided by Citizens or interface with ArenaLegends' specific bot handlers.

Last updated