Package me.neznamy.tab.api.scoreboard
Interface Scoreboard
public interface Scoreboard
An interface allowing to work with scoreboard, such as adding players,
removing players and changing lines. New instance can be created using
ScoreboardManager.createScoreboard(String, String, List),
for scoreboards from config ScoreboardManager.getRegisteredScoreboards().-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds line with specified text on the bottom of scoreboard.getLines()Returns list of lines in this scoreboard in the order they appear in game (first line is on top).getName()Returns internal name of this scoreboard.getTitle()Returns raw title of this scoreboard.voidremoveLine(int index) Removes line with specified index.voidSets title to specified value.voidUnregisters this scoreboard from all players who can see it.
-
Method Details
-
getName
String getName()Returns internal name of this scoreboard. Name is defined in registration, scoreboards from config use name they were defined with. This value is used internally and in /tab announce scoreboard command.- Returns:
- custom name of this scoreboard
-
getTitle
String getTitle()Returns raw title of this scoreboard. Placeholders stay in their raw format.- Returns:
- scoreboard title
- See Also:
-
setTitle
Sets title to specified value. Placeholders are refreshed automatically with refresh intervals defined in config. No need to call this method to try to keep placeholders up to date. Supports RGB codes using any of the supported formats.Length is limited to 32 characters on <1.13. If the limit is exceeded, text will be cut to 32 characters.
Calling this method with same title as before will not do anything.
- Parameters:
title- New title to use with placeholder support- See Also:
-
getLines
Returns list of lines in this scoreboard in the order they appear in game (first line is on top). This list should only be used for reading, for adding/removing lines seeaddLine(String)andremoveLine(int).- Returns:
- list of lines in this scoreboard
- See Also:
-
addLine
Adds line with specified text on the bottom of scoreboard. Supports placeholders, which will automatically be refreshed.- Parameters:
text- Text to display- See Also:
-
removeLine
void removeLine(int index) Removes line with specified index. Index starts at0and ends atgetLines().size()-1.- Parameters:
index- Index of line to remove, starting at 0- Throws:
IndexOutOfBoundsException- if the index is out of range (index < 0 || index >=getLines().size())- See Also:
-
unregister
void unregister()Unregisters this scoreboard from all players who can see it.
-