Points scoreboard

Discussion in 'Plugin Development' started by andrewmariocast, Nov 30, 2013.

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

    andrewmariocast

    I would like to have a sidebar that has the players score in the side bar. For example the sidebar would say:
    Points: 11

    I already have a working points system. I can do
    Code:java
    1. scores.getScore(player)
    to get a players score as and integer. But I do not know how to get this on a scoreboard.

    Thanks!
     
  2. Offline

    xTrollxDudex

    andrewmariocast
    Look at chasechocolate's tutorial I'm the resources section
     
  3. Offline

    andrewmariocast

    @xTrollxDudexI tried that but I could never get it to work with individual players

    Code:java
    1. public static void addPoints(Player p, int newPoints){
    2. int cPoints = points.get(p.getDisplayName()) + newPoints;
    3. //put points in hashmap
    4. points.put(p.getDisplayName(), cPoints);
    5.  
    6. pointsS.setScore(scores.getScore(p));
    7.  
    8. //Send nice message
    9. if (newPoints == 0){
    10. p.sendMessage(ChatColor.RED + "+ " + ChatColor.GOLD + newPoints + " point!");
    11. } else {
    12. p.sendMessage(ChatColor.RED + "+ " + ChatColor.GOLD + newPoints + " points!");
    13. }
    14.  
    15. }


    How could I send that to a player in a method

    bump

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
  4. Offline

    Aperx

    Maybe use an event, a join event, chat event ect.
     
Thread Status:
Not open for further replies.

Share This Page