Help with Scoreboards

Discussion in 'Spigot Plugin Development' started by Yauke, Jun 16, 2016.

Thread Status:
Not open for further replies.
  1. Hi! I need help with the scoreboards, I want to put a list from messages.yml in a scoreboard, like this:
    Example:
    Code (scoreboardingame (Unknown Language)):

            TITLE
    line1: 1          5
                      4
    line2: 2          3
                      2
    line3: 3          1
     
    Code (messagesyml (Unknown Language)):

    scoreboard:
      header: HEADER
      lines:
      - 'line1 %variable%'
      - ' '
      - 'line2 %variable%'
      - '  '
      - 'line3 %variable%'
     
     
  2. What have you tried?
     
  3. Code (Text):

                    /*
                     * l1, l2, l3, l4, l5 are Strings and get the text from yml file
                     */

                    objective = scoreboard.registerNewObjective("test", "dummy");
                    objective.setDisplaySlot(DisplaySlot.SIDEBAR);

                    objective.setDisplayName(title);

                    Score line1 = objective.getScore(l1);
                    line1.setScore(5);
                    Score space1 = objective.getScore(l2);
                    space1.setScore(4);
                    Score line2 = objective.getScore(l3);
                    line2.setScore(3);
                    Score space2 = objective.getScore(l4);
                    space2.setScore(2);
                    Score line3 = objective.getScore(l5);
                    line3.setScore(1);
     
     
Thread Status:
Not open for further replies.