Scoreboard Problem, Help!

Discussion in 'Plugin Development' started by Nosma_Stew, Feb 1, 2016.

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

    Nosma_Stew

    When a player joins the server, they are assigned a blank scoreboard. Whenever a player joins or the scoreboard gets updated meaning that when i kill someone or a zombie the scoreboard remains the same but when i log off and log back in then the scoreboard changes...anyone knows how i do it? i tried lot of codes from websites and other people problems but their code is not working for me. I might have to run a scheduler where it updates it but im not sure how i can do this cuz im just learning
    http://pastebin.com/aGaGHyh1

    this can be for the scoreboard but i don't know how i should really make it

    BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
    scheduler.scheduleSyncRepeatingTask(this, new Runnable() {
    @Override
    public void run() {
    // Do something
    }
    }, 0L, 20L);
    }
     
  2. Offline

    GamerzKing

    I'll quote the same as I did on Spigot:
    • You don't need to send an enable message, Bukkit does this for you.
    • You also don't need a disable message, Bukkit does this too, with the version.
    • What is your static 'A' ArrayList for? Also, remember to follow naming conventions.
    • Why is your 'Format' method static? You're only using it in that class.
    • Instead of replacing the "&" with the "ยง" symbol, use ChatColor#translateAlternateColorCodes for further compatibility.
    • To use the Runnable, the 0L is the delay, and the 20L is how often it repeats. So currently, it will run every 20 ticks.
    • Just send the player the scoreboard on update, and you should be all good!
    Hope I helped, and have a great day/night,
    - GamerzKing
     
Thread Status:
Not open for further replies.

Share This Page