ScoreboardLib
A flicker-free scoreboard library with support of text up to 48 characters.
ScoreboardLib is a flexible library for adding pretty, animated scoreboards to your plugin without requiring you to figure out how to get rid of random flickers or limitations. This library is introduced to dealt with following problems in the original API and similar libraries:
- Scoreboards cannot display text of more than 16 characters. Solved.
- Scoreboards cannot display the same text more than once. Solved.
- The scoreboard is flickering all the time. Solved.
- Random disappearance of lines. Solved.
Any screenshots?
Feel the awesomeness.
Other reasons to use ScoreboardLib?
- Simple to use. You just have to decide the user interface, ScoreboardLib already got the backend handled.
- Displays up to 48 characters instead of 16.
- Easy to implement animated text with help of ScrollableString and HighlightedString.
- Designed to be scalable and flexible.
- Performant. ScoreboardLib doesn't create a scoreboard every time the content is updated.
- Can be used as a standalone plugin, or be shaded into your project.
How do I add it to my project?
Simply add the following to your pom.xml.
Code (Text):
<repository>
<id>tiger-repo</id>
<url>http://repo.tigerhix.me/content/repositories/snapshots/</url>
</repository>
<dependency>
<groupId>me.tigerhix.lib</groupId>
<artifactId>scoreboard</artifactId>
<version>1.0.1-SNAPSHOT</version>
</dependency>
<id>tiger-repo</id>
<url>http://repo.tigerhix.me/content/repositories/snapshots/</url>
</repository>
<dependency>
<groupId>me.tigerhix.lib</groupId>
<artifactId>scoreboard</artifactId>
<version>1.0.1-SNAPSHOT</version>
</dependency>
How do I use it?
First, you have to decide whether you use ScoreboardLib as a standalone plugin, or you just go shade it into your own plugin. For the latter case, you have to add following code to your onEnable():
Code (Text):
ScoreboardLib.setPluginInstance(this);
For the scoreboard itself, here is an usage example:
Code (Text):
for (Player player: getServer().getOnlinePlayers()) {
Scoreboard scoreboard = ScoreboardLib.createScoreboard(player)
.setHandler(new ScoreboardHandler() {
private final ScrollableString scroll = new ScrollableString(Strings.format("&aThis string is scrollable!"), 40, 0);
private final HighlightedString highlighted = new HighlightedString("This string is highlighted!", "&6", "&e");
@Override
public String getTitle(Player player) {
return null;
}
@Override
public List<Entry> getEntries(Player player) {
return new EntryBuilder()
.next(" " + scroll.next())
.next(" " + highlighted.next())
.blank()
.next(" &b&lCURRENT TIME MILLIS")
.next(" " + System.currentTimeMillis())
.blank()
.next(" &c&lCURRENT NANO TIME")
.next(" " + System.nanoTime())
.blank()
.next(" &7This line is equivalent to another line")
.next(" &7This line is equivalent to another line")
.blank()
.build();
}
})
.setUpdateInterval(2l);
scoreboard.activate();
}
Scoreboard scoreboard = ScoreboardLib.createScoreboard(player)
.setHandler(new ScoreboardHandler() {
private final ScrollableString scroll = new ScrollableString(Strings.format("&aThis string is scrollable!"), 40, 0);
private final HighlightedString highlighted = new HighlightedString("This string is highlighted!", "&6", "&e");
@Override
public String getTitle(Player player) {
return null;
}
@Override
public List<Entry> getEntries(Player player) {
return new EntryBuilder()
.next(" " + scroll.next())
.next(" " + highlighted.next())
.blank()
.next(" &b&lCURRENT TIME MILLIS")
.next(" " + System.currentTimeMillis())
.blank()
.next(" &c&lCURRENT NANO TIME")
.next(" " + System.nanoTime())
.blank()
.next(" &7This line is equivalent to another line")
.next(" &7This line is equivalent to another line")
.blank()
.build();
}
})
.setUpdateInterval(2l);
scoreboard.activate();
}
To remove the scoreboard, use:
Code (Text):
scoreboard.deactivate();
More...
Source code released under GNU LGPL License. Star it if you like it.
https://github.com/TigerHix/ScoreboardLib
My other resources:
If you have any questions, ask them in the thread - after all, posting an error log in the review section wouldn't help anyone
If ScoreboardLib helps you, consider leaving a like. A review would be also appreciated!
Quick facts
- Edition: Minecraft Java
- File type: .jar
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
ScoreboardLib is a free Minecraft Java mod. Downloaded 1,966 times (via Spigot). Download it and open it directly in the game.