VitalPlayerScoreboard

Defines a per-player based scoreboard implementation within the Vital-Framework. Per-played scoreboards should be used when displaying data, that is tied to a specific player on the server.

@Bean
public VitalPlayerScoreboard myPlayerScoreboard() {
return new VitalPlayerScoreboard(
player -> "Title for player " + player.getName(),
player -> "Line 1 for " + player.getName(),
player -> "Line 2 for " + player.getName(),
player -> "Line 3 for " + player.getName()
);
}

Constructors

Link copied to clipboard
constructor(title: Function<SpigotPlayer, String>, vararg lines: Function<SpigotPlayer, String>)

Properties

Link copied to clipboard

The lines-functions for this scoreboard. If modified, calls the update function to automatically update this scoreboard for all players.

Link copied to clipboard
Link copied to clipboard

The title function for this scoreboard. If modified, calls the update function to automatically update this scoreboard for all players.

Functions

Link copied to clipboard
fun addPlayer(player: SpigotPlayer, update: Boolean = true)

Adds the given player to this scoreboard. If the given player is already in this scoreboard, this function will override that scoreboard.

Link copied to clipboard
fun removePlayer(player: SpigotPlayer, update: Boolean = true)

Removes the given player from this scoreboard. If the given player is not in this scoreboard, this function does nothing.

Link copied to clipboard
fun update()

Updates this scoreboard for all players. If this scoreboard has no players, this function does nothing.

fun update(player: SpigotPlayer)

Updates this scoreboard for the given player. If the given player is not in this scoreboard, this function does nothing.