ONLY WORKS IN 1.8.8
You are free to use this code for public or commercial projects (MIT License)
How change the lines in the scoreboard: In config.yml you can change the lines and update time
- Default config:
Code (Text):
lines-update:
enable: true # false = the sidebar only is updated on player join
seconds: 5
animated-title: # Less resource usage
enable: true
seconds: 2
lines:
- "&e&lYou server"
- "&f&lY&e&lou server"
- "&f&lYo&e&lu server"
- "&f&lYou&e&l server"
- "&f&lYou s&e&lerver"
- "&f&lYou se&e&lrver"
- "&f&lYou ser&e&lver"
- "&f&lYou serv&e&ler"
- "&f&lYou serve&e&lr"
- "&f&lYou server"
title: "&e&lYou server" # Don't support placeholder in title
lines:
- "&bName: &f%qplayer_name%"
- "&bPing: &f%qplayer_ping%ms"
- ""
- "&bQScoreboard v7.0:"
- " &fAdd animated title"
placeholder-api-support: true
# Lightweight placeholders for don't download an extension in placeholderapi
#
# qplayer:
# %qplayer_name% : player name
# %qplayer_displayname% : custom playername
# %qplayer_ping% : player ping
#
# qserver:
# %qserver_online% : amount of player online
enable-custom-placeholders:
qplayer: true
qserver: false
How plugin works?:
The plugin uses packets for send and update the sidebar lines, example code:
Code (Text):
public void setLines(final PlayerConnection connection, final Player player) {
// Send lines with placeholders
for (PlaceholderLine line : customLines) {
setScore(line.getScore());
setPlayerName(placeholder.transform(line.getLine(), player));
connection.sendPacket(new PacketPlayOutScoreboardScore(this));
}
//Send lines without placeholders
for (PacketPlayOutScoreboardScore packet : loadedPackets) {
connection.sendPacket(packet);
}
}
Scoreboard update:
Code (Text):
public void updateSidebar() {
serverScoreboard.setDisplaySlot(1, new SidebarObjective(serverScoreboard));
for (EntityPlayer entityPlayer : onlinePlayers) {
setSidebar(entityPlayer, entityPlayer.getBukkitEntity().getPlayer());
}
}
PlaceholderApi is optional?:
Yes, the plugin don't need placeholderapi to work but is recommended for more customization.
Customizable placeholders (Need placeholderapi to works):
The plugin contains custom placeholders for don't download a extesion with /papi ecloud download (extension)
Extensions:
- QServer:
%qserver_online% : amount of player online
- QPlayer:
%qplayer_name% : player name
%qplayer_displayname% : custom playername
%qplayer_ping% : player ping