Class ScoreboardSlot

java.lang.Object
dev.jorel.commandapi.wrappers.ScoreboardSlot

public class ScoreboardSlot extends Object
A representation of scoreboard display slots, as well as team colors for the sidebar
  • Constructor Summary

    Constructors
    Constructor
    Description
    Determines the scoreboard slot value based on an internal Minecraft integer
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bukkit.scoreboard.DisplaySlot
    Gets the display slot of this scoreboard slot.
    org.bukkit.ChatColor
    Gets the team color of this scoreboard slot.
    boolean
    Returns whether this scoreboard slot has a team color.
    of(org.bukkit.scoreboard.DisplaySlot slot)
    Constructs a ScoreboardSlot from a DisplaySlot
    ofTeamColor(org.bukkit.ChatColor color)
    Constructs a ScoreboardSlot from a ChatColor
    Returns the Minecraft string representation of this scoreboard slot

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ScoreboardSlot

      public ScoreboardSlot(int i)
      Determines the scoreboard slot value based on an internal Minecraft integer
      Parameters:
      i - the scoreboard slot value
  • Method Details

    • of

      public static ScoreboardSlot of(org.bukkit.scoreboard.DisplaySlot slot)
      Constructs a ScoreboardSlot from a DisplaySlot
      Parameters:
      slot - the display slot to convert into a ScoreboardSlot
      Returns:
      a ScoreboardSlot from the provided DisplaySlot
    • ofTeamColor

      public static ScoreboardSlot ofTeamColor(org.bukkit.ChatColor color)
      Constructs a ScoreboardSlot from a ChatColor
      Parameters:
      color - the chat color to convert into a ScoreboardSlot
      Returns:
      a ScoreboardSlot from the provided ChatColor
    • getDisplaySlot

      public org.bukkit.scoreboard.DisplaySlot getDisplaySlot()
      Gets the display slot of this scoreboard slot.
      Returns:
      this scoreboard slot's display slot
    • getTeamColor

      public org.bukkit.ChatColor 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

      public boolean hasTeamColor()
      Returns whether this scoreboard slot has a team color.
      Returns:
      true if this scoreboard slot has a team color
    • toString

      public String toString()
      Returns the Minecraft string representation of this scoreboard slot
      Overrides:
      toString in class Object
      Returns:
      the Minecraft string representation of this scoreboard slot