Util SimpleScoreboard - Make pretty scoreboards with ease!

Discussion in 'Resources' started by RainoBoy97, Apr 30, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    mazentheamazin

    Squid_Boss
    You shouldn't be calling Bukkit#getOfflinePlayer(String) when there scoreboard methods have default string methods available.

    As well, I have updated the gist to remove flickering and fix bugs :) If you haven't checked it out, look here!
     
    GrandmaJam likes this.
  2. Offline

    Squid_Boss

  3. Offline

    samus1221


    I don't understand how you can update specific indexes? Can you give an example?
     
  4. Offline

    mazentheamazin

    samus1221
    So the design is made so you could do this:
    Code:java
    1. simpleScoreboard.set(/* You can put an int here or call the indexOf method */, "new string");
     
  5. Offline

    samus1221


    What I was trying to do was update certain indexes via different methods. Is there a way of getting a specific simplescoreboard of a player?
     
  6. Offline

    mazentheamazin

    samus1221
    Sadly you'll have to store that data in a hashmap.
     
  7. Offline

    coco5843

    I made this method to update scoreboard,but it's not work :/ can you help me ?:

    Code:java
    1. public void updateLobbyScoreboard (Lecteur p, String compte, String maxPlayer, temps String, réinitialisation booléenne) {
    2.  
    3. SimpleScoreboard tableau de bord = new SimpleScoreboard (temps);
    4. scoreboard.blankLine ();
    5. scoreboard.add ("§ e § lPlayers:");
    6. scoreboard.add ("§ e § l" + count + "/" + maxPlayer);
    7. scoreboard.blankLine ();
    8. scoreboard.blankLine ();
    9. scoreboard.build ();
    10. scoreboard.send (p);
    11.  
    12. si (reset) {
    13. scoreboard.reset ();
    14. scoreboard.build ();
    15. scoreboard.send (p);
    16. }
    17.  
    18.  
    19. }


    No sorry it's work now , Thank's , I use this :
    Code:java
    1. public void resetScoreboard(Player p) {
    2. SimpleScoreboard scoreboard = new SimpleScoreboard("");
    3. scoreboard.build();
    4. scoreboard.send(p);
    5. scoreboard.reset();
    6. }
     
    GrandmaJam likes this.
  8. Offline

    mazentheamazin

  9. Offline

    TigerHix

    mazentheamazin This don't seem to work well in latest Bukkit, since getOfflinePlayer() will access Mojang's server and causes lag on server..
     
  10. Offline

    mazentheamazin

    TigerHix
    I see what you mean, for the most part I copied + pasted the code from his post and modified it. I'll update it shortly :)
     
  11. Offline

    bluegru

    Awesome library,

    Is there a way to remove the scoreboard so that the player don't see it anymore?

    And some Ideas:
    A way to edit an existing scoreboard would be awesome, so that I can change some lines.
    And a method to get the SimpleScoreboard by the player name. So that I can remove the scoreboard at an event.
     
  12. Offline

    HeavyMine13

    Can we PLEASE have an update(); method, so like I update person points every 4 ticks ;-;
     
    GrandmaJam likes this.
  13. Offline

    123ang

    RainoBoy97 Your library doesn't add the score if you put like scoreboard.add("test"); in a runnable. Any other way of updating? Please answer, otherwise I can't use this without an update method.
     
  14. Offline

    HeavyMine13

    Squid_Boss I have that method in a runnable and it does not work.
     
  15. Offline

    samus1221

    mazentheamazin I am having trouble with the set method, specifically the string key. It keeps coming back that there isn't anything set in the listing in the get method that returns the list.
    Code:java
    1. public ScoreboardHandler set(int index, String newText) {
    2. String key = get(index).get(0);
    3. int position = indexOf(key);
    4. scores.remove(key);
    5. scores.put(newText, position);
    6. return this;
    7. }


    It is an out of bounds exception, if you could explain how I could be getting this exception that would be great. I thank you in advance.
     
  16. Offline

    mazentheamazin

    samus1221
    That means the index you have provided has no scoreboard entries.
     
  17. Offline

    samus1221

    mazentheamazin
    I thought so, I am trying to store the scoreboards in a hashmap for each player.

    mazentheamazin Can you give me an example of how I would store a player scoreboard in a hashmap to edit later on? I would greatly appreciate it.

    Btw the version of my plugin is not an up-to-date version, I am using 1.7.2 R.0.3 just incase that does affect anything.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 9, 2015
  18. Offline

    viper_monster

    samus1221 you don't actually have to store it, you can just get it like this:

    Code:java
    1. Scoreboard scoreboard = Player.getScoreboard().getObjective(DisplaySlot.SIDEBAR) == null ? ScoreboardManager.getNewScoreboard() : Player.getScoreboard();
     
  19. Offline

    refz

    dude wtf
    how can i disable the descending order thing it looks autistic on mine and how do i make it update when i die and get a kill
    kthx
    [​IMG]
     
  20. Offline

    JaguarJo Retired Staff

    Removed comments not fit for a civilized discussion and posts discussing the validity of the removed comments. Please avoid language that could be considered flaming or hurtful to other users. Thank you for your cooperation.
     
    samus1221 likes this.
  21. Offline

    HeavyMine13

    I still need a way to update the scoreboard without the flickering, I tried different ways but nothing is working!
     
  22. Offline

    samus1221

    HeavyMine13 Make a hashmap to store the players that have already received the scoreboard, then whenever you need to update it check to see if they have already have a scoreboard displayed then use the set method to update it.
     
  23. Offline

    viper_monster

    samus1221 Why?! Why should he store it? He can get it using Player#getScoreboard()
     
  24. Offline

    samus1221



    viper_monster Alright now tell me how would you update it using the methods mazentheamazin created within the gist...
     
  25. Offline

    viper_monster

    samus1221 you can easily edit his gist to suit your needs.
     
  26. Offline

    Matthewenderle

    How does one close the scoreboard. I've tried iterating a nulled one and that hasn't worked.
     
  27. Offline

    JABBZxLILJAY320

    player.setScoreboard(Bukkit.getScoreboardManager().getNewScoreboard());
     
  28. Offline

    lucasdidur

    When I try to use the demo code, I get this error:

    PHP:
    Caused byjava.lang.IllegalArgumentExceptionName cannot be blank
        at com
    .google.common.base.Preconditions.checkArgument(Preconditions.java:88) ~[spigot_1710_R2.jar:git-Spigot-1.7.9-R0.2-205-g6a8d903]
        
    at org.bukkit.craftbukkit.v1_7_R4.CraftServer.getOfflinePlayer(CraftServer.java:1395) ~[spigot_1710_R2.jar:git-Spigot-1.7.9-R0.2-205-g6a8d903]
        
    at org.bukkit.Bukkit.getOfflinePlayer(Bukkit.java:436) ~[spigot_1710_R2.jar:git-Spigot-1.7.9-R0.2-205-g6a8d903]
        
    at com.ehaqui.ehmessage.messagetype.ScoreboardMessage.build(ScoreboardMessage.java:96) ~[?:?]
     
  29. Offline

    Speaw

    http://prntscr.com/4zwfh4
    Code:java
    1. ScoreboardApi scoreboard = new ScoreboardApi("§6§lMob Defense");
    2. scoreboard.blankLine();
    3. scoreboard.add(ChatColor.GREEN + "Players: " + ChatColor.YELLOW + Main.instance.arena.size());
    4. scoreboard.blankLine();
    5. scoreboard.build();
    6. for(Player oyuncular : Main.instance.arena){
    7. scoreboard.send(oyuncular);
    8. }
    9. }
     
  30. Offline

    coco5843


    me too
     
Thread Status:
Not open for further replies.

Share This Page