Glaedr

Status
This thread has been locked.

Rj

PhD Aerospace Engineering
Supreme
Feedback score
7
Posts
740
Reactions
220
Resources
1
Alright I can't seem how to figure out how to make this work:

I am making when a player hits someone it will show up on the scoreboard. I am using Glaedr API for it heres the code i got so far

onEnable
Code:
        this.glaedr = new Glaedr(this, ConfigManager.get("scoreboard.yml").getString("scoreboard.title"), true, true, false);
        this.glaedr.getBottomWrappers().add("&7&m--------------------");
        this.glaedr.getTopWrappers().add("&7&m--------------------");
        this.glaedr.registerPlayers();

Code:
    @EventHandler
    public void onDamage(EntityDamageByEntityEvent e) {
        if (e.getDamager() instanceof Player && e.getEntity() instanceof Entity) {
            Player damager = (Player) e.getDamager();

            PlayerScoreboard scoreboard = PlayerScoreboard.getScoreboard(damager);
            new Entry("CT", scoreboard)
                    .setCountdown(true)
                    .setText(ChatColor.GOLD + "Combat" + ChatColor.GRAY + ":")
                    .setTime(45)
                    .send();

        }
Combat Tag^ I get the message that it on like
I did register the event in the main class.
When i hit a player nothing happens!
"Scoreboard created in 12ms or something like that"
 
ReliableSite: Dedicated Servers

Rj

PhD Aerospace Engineering
Supreme
Feedback score
7
Posts
740
Reactions
220
Resources
1
Heck if the entry exists already, if not give them a new entry, else grab that entry and set the time back to 45
What would i keep the entry as? Sorry for asking but this is my first time working with Glaedr
 

Rj

PhD Aerospace Engineering
Supreme
Feedback score
7
Posts
740
Reactions
220
Resources
1
Two things.

1) The public version of glaedr is very buggy, and will cause a server to run at 12 tps with 150 players on. (Experienced it the hard way)

2) Monkey is right, check if it exists. so do a little something like

if(scoreboard.getEntry("ct") != null) {
//Checking if it exists.
}
else
{
//if it doesnt exist.
}
What version of glaedr should i use?[DOUBLEPOST=1467685639][/DOUBLEPOST]
What version of glaedr should i use?
& I did that on a cmd and it still doesnt work.
 

Rj

PhD Aerospace Engineering
Supreme
Feedback score
7
Posts
740
Reactions
220
Resources
1
He has a private version that isn't laggy, good luck getting it though.

Glaedr should run fine unless you got more than 150 people on with a running koth on the scoreboard.
Can you give me a piece of code, I've tried 100's of different ways. I've got nothing to work.
 
Status
This thread has been locked.
Top
You need to upgrade!
Our dark style is reserved for our Premium members. Upgrade here.