1.13 Scoreboard API is confusing me as I attempt to make my first mini-game.

Discussion in 'Spigot Plugin Development' started by Quirkylee, Jul 29, 2018.

  1. The scenario I am trying to achieve is to have a game status that says like waiting or the number players in the queue to play that round at the top of the scoreboard then display the player's position like first, second, third, etc. I was wondering if someone could give me an example of how to use the 1.13 Scoreboard API?

    Long story short I simply don't understand it and the documentation on the wiki hasn't been updated yet.
     
    #1 Quirkylee, Jul 29, 2018
    Last edited: Jul 29, 2018
  2. bump as no buddy answered me and hope that someone will help.
     
  3. md_5

    Administrator Developer

    Its the same as the 1.12.2 API....
     
    • Like Like x 2
    • Funny Funny x 2
  4. I first want to thank you for replying and for your time!

    There have been noticeable changes compared to 1.12 but functionality the almost the same for the most part there are a few depreciations as you probably know. Why I say that is because I read our bible the javadocs.

    There is somethings like addEntry() doesn't show an entry on the scoreboard for some reason. Perhaps I can share my code so you can point out the obvious. ;)

    Code (Java):
            scoreboard.registerNewObjective("status","dummy", "Run For Your Life");
            status = scoreboard.getObjective("status");
            status.setDisplaySlot(DisplaySlot.SIDEBAR);
            scoreboard.registerNewTeam("status");
            statusDisplay = scoreboard.getTeam("status");
            statusDisplay.setDisplayName(ChatColor.BOLD+"0/"+track.getMaxPlayers());
            Score st = status.getScore("status");
            st.setScore(track.getMaxPlayers()+1);
        }
        public void addPlayer(PlayerEntity player) {
            if (player.getState().equals(PlayerStates.JOINED)) {
                statusDisplay.setDisplayName(ChatColor.BOLD+""+slots.size()+"/"+track.getMaxPlayers());
                statusDisplay.setPrefix("test");
                statusDisplay.addEntry(player.getDisplayName());
                statusDisplay.setSuffix("test");
                player.setScoreboard(scoreboard);
            }
        }
     
     
    #4 Quirkylee, Jul 31, 2018
    Last edited: Aug 1, 2018