Solved Updating scoreboard

Discussion in 'Plugin Development' started by Nuno_Facha, Jul 2, 2015.

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

    Nuno_Facha

    Can anybody give me an exemple how to update this scoreboard without it flashing?

    I have tried in many ways and is always flashing

    Create method:
    Code:
        public static void createScore(Player p) throws SQLException {
            Scoreboard board = Bukkit.getScoreboardManager().getNewScoreboard();
            Objective o = board.registerNewObjective("a", "dummy");
            o.setDisplayName("§2§l***");
            o.setDisplaySlot(DisplaySlot.SIDEBAR);
            Score rank = o.getScore("§bSeu Rank:");
            Score rankData = o.getScore("  " + RankUtils.getNameById(PlayerUtils.getRankId(PlayerUtils.getIdByName(p.getName()))));
            Score money = o.getScore("§2Money:");
            Score moneyData = o.getScore("  " + Main.economy.getBalance(p.getName()));
            rank.setScore(4);
            rankData.setScore(3);
            money.setScore(2);
            moneyData.setScore(1);
            p.setScoreboard(board);
        }
     
  2. Offline

    caseif

    How are you updating it? Are you calling the createScore method each time?
     
  3. Offline

    Nuno_Facha

    I was trying something like this:
    [​IMG]

    But it makes the scoreboard flash
     
  4. Offline

    HenkDeKipGaming

    you could make a java loop and set it to like 2 seconds, it shouldn't flash then
     
  5. Offline

    WesJD

    @HenkDeKipGaming What?
    @Nuno_Facha If you really don't want to go that deep into making a scoreboard that doesn't flicker at all, the most reliable solution is to use the same objective instead of creating a new one.
     
  6. Offline

    caseif

    Regardless of whether the flickering is a concern, you shouldn't be creating a new objective every time you update it anyway.
     
Thread Status:
Not open for further replies.

Share This Page