Overview | EssentialsC | ScoreboardApi
net.godlycow.org.essc.api

Interface ScoreboardApi

public interface ScoreboardApi

API interface for interacting with EssentialsC's scoreboard system. Provides control over per-player scoreboard visibility and global system state. Scoreboards are configured in config.yml and update asynchronously with placeholder support.

Retrieve an instance via EssentialsCAPI.getScoreboardApi().

ScoreboardApi sb = APIProvider.getAPI().getScoreboardApi();

if (sb.isEnabled(player)) {
    sb.toggle(player);
}

All state changes persist across sessions if persistence is enabled in config.

Method Summary

void toggle(Player player)
Toggles the scoreboard visibility for the given player.
boolean isEnabled(Player player)
Returns whether the scoreboard is currently enabled for the given player.
boolean isGloballyEnabled()
Returns whether the scoreboard system is globally enabled in config.
void reload()
Reloads the scoreboard configuration from disk.
Method Detail
public void toggle(Player player)

Toggles the scoreboard visibility for the given player.

If the scoreboard is currently shown, it will be hidden and the player is added to the disabled list. If hidden, it will be shown. Persists across sessions if persistence is enabled in config.

Warning: Must be called on the main thread.
Parameters:
playerthe player to toggle; must not be null
public boolean isEnabled(Player player)

Returns whether the scoreboard is currently enabled for the given player.

Returns false if the player has toggled it off, even if the global system is enabled.

Parameters:
playerthe player to check; must not be null
Returns:
booleantrue if the player has the scoreboard visible
public boolean isGloballyEnabled()

Returns whether the scoreboard system is globally enabled in config.

Returns:
booleantrue if scoreboards are enabled server-wide
public void reload()

Reloads the scoreboard configuration from disk.

Re-reads config.yml, stops all current scoreboards, and restarts them with the new configuration. This is equivalent to /scoreboard reload.

Warning: Must be called on the main thread.