Scoreboard

interface Scoreboard

A Scoreboard is a method of keeping track of scores. These are primarily for use in minigames.

Types

Link copied to clipboard
object Companion
Link copied to clipboard
@ApiStatus.Internal
interface Factory

Functions

Link copied to clipboard
abstract fun addObjective(name: String, criterion: Criterion, displayName: Component, renderType: ObjectiveRenderType): Objective

Creates a new objective with the given name, criterion, displayName, and renderType, and adds it to this scoreboard.

Link copied to clipboard
abstract fun addTeam(name: String): Team

Creates a new team with the given name and adds it to the list of registered teams for this scoreboard.

Link copied to clipboard
abstract fun clearSlot(slot: DisplaySlot)

Clears any objective in the given slot.

Link copied to clipboard
@Contract(value = "_ -> new", pure = true)
abstract fun createObjectiveBuilder(): Objective.Builder

Creates a new builder for building an objective that will be registered to this scoreboard.

Link copied to clipboard

Creates a new builder for building a team with the given name that will be registered to this scoreboard.

Link copied to clipboard
abstract fun getMemberTeam(member: Component): Team?

Gets the team that the given member is in on this scoreboard, or returns null if there is no team with the given member in it.

Link copied to clipboard
abstract fun getObjective(name: String): Objective?

Gets the objective with the given name, or returns null if there are no objectives registered with this scoreboard with the given name.

abstract fun getObjective(slot: DisplaySlot): Objective?

Gets the objective in the given slot, or returns null if there are no objectives registered with this scoreboard in the given slot.

Link copied to clipboard
abstract fun getOrAddTeam(name: String): Team

Gets the existing team with the given name, or creates a new team with the given name and adds it to the list of registered teams for this scoreboard.

Link copied to clipboard
abstract fun getTeam(name: String): Team?

Gets the team with the given name if there is one registered with this scoreboard, or returns null if there is not.

Link copied to clipboard
abstract fun removeObjective(objective: Objective)

Removes the given objective from this scoreboard's list of registered objectives.

Link copied to clipboard
abstract fun removeTeam(team: Team)

Removes the given team from this scoreboard's list of registered teams.

Link copied to clipboard
abstract fun updateSlot(objective: Objective?, slot: DisplaySlot)

Updates the objective in the given slot to be the given objective, clearing the objective at the given slot if the given objective is null.

Properties

Link copied to clipboard

All objectives registered on this scoreboard.

Link copied to clipboard
abstract val teams: Collection<Team>

All teams tracked by this scoreboard.