HCF Core Scoreboard

Status
This thread has been locked.

felldownstairs

Gypsy Boy | Java Developer
Supreme
Feedback score
4
Posts
783
Reactions
144
Resources
0
How would I add an arraylist, and after someone enderperls, put them in this arraylist for a certain amount of time, then display it on the scoreboard with a timer, then remove after a certain amount of time. i would really appreciate help with this, please only comment if you can help with this. i am using the bukkit scoreboard api, since no one will tell me how the ihcf scoreboard api works and all others are apparently shit.
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Nerm

Deactivated
Feedback score
21
Posts
851
Reactions
714
Resources
0
PlayerInteract check if they the action is right click air and the item in there hand is an enderpearl and if they're not in the list add them if they are cancel and make a runnable after 15s remove them. Make a runnable in your scoreboard class I don't really know, I haven't tested too much with this..
 

felldownstairs

Gypsy Boy | Java Developer
Supreme
Feedback score
4
Posts
783
Reactions
144
Resources
0
PlayerInteract check if they the action is right click air and the item in there hand is an enderpearl and if they're not in the list add them if they are cancel and make a runnable after 15s remove them. Make a runnable in your scoreboard class I don't really know, I haven't tested too much with this..
how would i turn the time left into an int to display on the scoreboard?
 

Nerm

Deactivated
Feedback score
21
Posts
851
Reactions
714
Resources
0
Make a Runnable with 20L and do as so and extend BukkitRunnable

public static int i = 15;

public void run() {
i--;
}
if (pearl.contains(p.getUniqueID()) {
scoreboard.setPrefix("Enderpearl");
scoreboard.setSuffix(String.valueOf(i));
}

I didn't right it down entirely something like that.
 

felldownstairs

Gypsy Boy | Java Developer
Supreme
Feedback score
4
Posts
783
Reactions
144
Resources
0
would this work with displaying it as Enderpearl: 16s instead of Enderpearl: 16 thing?
 

felldownstairs

Gypsy Boy | Java Developer
Supreme
Feedback score
4
Posts
783
Reactions
144
Resources
0
just add "s" after it. in the scoreboard
thanks, also if you dont mind answering how would i display something like Vanish: Enabled if they are in an arraylist or something like Vanish: Disabled if they are not
 

Nerm

Deactivated
Feedback score
21
Posts
851
Reactions
714
Resources
0
You can use boolean instead of ArrayLists you start of as
Code:
pubic boolean vanished = false;
then if they click it set it to true if they click it again set it to false and just display the boolean.
 

felldownstairs

Gypsy Boy | Java Developer
Supreme
Feedback score
4
Posts
783
Reactions
144
Resources
0
You can use boolean instead of ArrayLists you start of as
Code:
pubic boolean vanished = false;
then if they click it set it to true if they click it again set it to false and just display the boolean.

i am now getting this error, could you help me out please?
 

Edvio

Feedback score
8
Posts
351
Reactions
113
Resources
0
You obviously don't know anything about coding, since you're trying to reach a variable from outside the method. This wouldn't work anyway, cause Bukkit scoreboard api only allows 16 characters per line, so most of it would disappear. I would recommend learning Java and the Bukkit api before trying to make a HCF core.
I'm just gonna point out all the errors in this:
you don't have ; after a for loop.
you don't need getServer()
you're adding the player to the arraylist as many times as the amount of online players, so it wouldn't work to toggle off.
Storing player's in an arraylist is inefficient.
you check the cmd.getname after the for loop, which means it's gonna check the cmd.getname for every online player, which is just stupid
 

Fle

Top tier Random.
Supreme
Feedback score
11
Posts
1,025
Reactions
425
Resources
0
Edvio Really no point to talk down upon the OP, it's clear you tried to help him, but the "you clearly don't know anything" part was not necessary.
 

Hunting_Potato

Developer
Deactivated
Feedback score
11
Posts
745
Reactions
425
Resources
0
Use system time for enderpearl cooldowns, don't know why a runnable would be nessasary in this case. The scoreboard runnable can handle updating the entry.
 
Status
This thread has been locked.
Top