CommandAPI 8.8.0
An API for the command UI introduced in Minecraft 1.13
dev.jorel.commandapi.wrappers.ScoreboardSlot Class Reference

A representation of scoreboard display slots, as well as team colors for the sidebar. More...

Public Member Functions

 ScoreboardSlot (int i)
 Determines the scoreboard slot value based on an internal Minecraft integer. More...
 
DisplaySlot getDisplaySlot ()
 Gets the display slot of this scoreboard slot. More...
 
ChatColor getTeamColor ()
 Gets the team color of this scoreboard slot. More...
 
boolean hasTeamColor ()
 Returns whether this scoreboard slot has a team color. More...
 
String toString ()
 Returns the Minecraft string representation of this scoreboard slot. More...
 

Static Public Member Functions

static ScoreboardSlot of (DisplaySlot slot)
 Constructs a ScoreboardSlot from a DisplaySlot. More...
 
static ScoreboardSlot ofTeamColor (ChatColor color)
 Constructs a ScoreboardSlot from a ChatColor. More...
 

Detailed Description

A representation of scoreboard display slots, as well as team colors for the sidebar.

Constructor & Destructor Documentation

◆ ScoreboardSlot()

dev.jorel.commandapi.wrappers.ScoreboardSlot.ScoreboardSlot ( int  i)

Determines the scoreboard slot value based on an internal Minecraft integer.

Parameters
ithe scoreboard slot value

Member Function Documentation

◆ getDisplaySlot()

DisplaySlot dev.jorel.commandapi.wrappers.ScoreboardSlot.getDisplaySlot ( )

Gets the display slot of this scoreboard slot.

Returns
this scoreboard slot's display slot

◆ getTeamColor()

ChatColor dev.jorel.commandapi.wrappers.ScoreboardSlot.getTeamColor ( )

Gets the team color of this scoreboard slot.

Returns
this scoreboard slot's team color, or null if a team color is not present

◆ hasTeamColor()

boolean dev.jorel.commandapi.wrappers.ScoreboardSlot.hasTeamColor ( )

Returns whether this scoreboard slot has a team color.

Returns
true if this scoreboard slot has a team color

◆ of()

static ScoreboardSlot dev.jorel.commandapi.wrappers.ScoreboardSlot.of ( DisplaySlot  slot)
static

Constructs a ScoreboardSlot from a DisplaySlot.

Parameters
slotthe display slot to convert into a ScoreboardSlot
Returns
a ScoreboardSlot from the provided DisplaySlot

◆ ofTeamColor()

static ScoreboardSlot dev.jorel.commandapi.wrappers.ScoreboardSlot.ofTeamColor ( ChatColor  color)
static

Constructs a ScoreboardSlot from a ChatColor.

Parameters
colorthe chat color to convert into a ScoreboardSlot
Returns
a ScoreboardSlot from the provided ChatColor

◆ toString()

String dev.jorel.commandapi.wrappers.ScoreboardSlot.toString ( )

Returns the Minecraft string representation of this scoreboard slot.

Returns
the Minecraft string representation of this scoreboard slot