Solved Clockformat error at ScoreBoard with Team

Discussion in 'Spigot Plugin Help' started by AtomBaba, Aug 11, 2018.

Thread Status:
Not open for further replies.
  1. Hi, I'm coding a 1vs1 plugin for my server. I have a problem with Scoreboards, Thank you for your help.
    Code (Text):
        public static void inGameScoreBoard(Player player) {
            Date clock = new Date();
            SimpleDateFormat clockformat = new SimpleDateFormat("hh:mm:ss a");
           
            ScoreboardManager ingamesbm = Bukkit.getScoreboardManager();
            Scoreboard ingamesb = ingamesbm.getNewScoreboard();
            Objective ingameobj = ingamesb.registerNewObjective("inGame", "dummy");
            ingameobj.setDisplaySlot(DisplaySlot.SIDEBAR);
            ingameobj.setDisplayName("§b§lTest");
           
            Score sunucuzamani = ingameobj.getScore("§fSunucu Zamanı:");
            sunucuzamani.setScore(2);
           
            Team sunucuzamani1 = ingamesb.registerNewTeam("sunucuzamani1");
            sunucuzamani1.addEntry("§f");
            sunucuzamani1.setPrefix("§f    " + clockformat.format(clock).toString());
            ingameobj.getScore("§f").setScore(1);
           
            player.setScoreboard(ingamesb);
            return;
        }
     
  2. My error is:
     

    Attached Files:

  3. I have solved my problem with remove §f in
    Code (Text):
            sunucuzamani1.setPrefix("    " + clockformat.format(clock));
     
Thread Status:
Not open for further replies.

Share This Page