ChatColors doesn't work

Discussion in 'Plugin Development' started by BigBuildig2011, Apr 3, 2014.

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

    BigBuildig2011

    I have a problem.I want to add a player to a scoreboard , like here:
    Code:java
    1. Score s = null;
    2. s = obj.getScore(Bukkit.getOfflinePlayer(ChatColor.RED + Playername));

    But everytime I do this , It returns (I must say my nickname is BigBuilding2011): nullBigBuilding2011
    The other problem is , that this is a too long string and i can't add it to the scoreboard
     
  2. Offline

    Glumpz

    What is BigBuilding2011 referring too?
     
  3. Offline

    The Fancy Whale

    BigBuildig2011 Do
    Code:java
    1. s = obj.getScore(Bukkit.getOfflinePlayer(ChatColor.RED + "" + Playername));
     
  4. Offline

    BigBuildig2011

    @The Fancy Whale
    I think it works better now , but not how i expected it to work
    Glumpz
    It's just a normal String ,which i get by
    Code:java
    1. String PlayerName = p.getDisplayName();


    But i have another problem now:
    I want to add it to my scoreboard.But it says ,
    java.io.IOException: the received string lenght is longer than maximum alloweds (18 > 16)
     
  5. Offline

    gyus

    Offline Players are not saved with a color name. You have to get it with no color.
     
  6. Offline

    BigBuildig2011

    So , is there a way to put a colored playername on a scoreboard?
     
Thread Status:
Not open for further replies.

Share This Page