PlayerName Colour Error

Discussion in 'Plugin Development' started by AlexHH251997, Oct 10, 2013.

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

    AlexHH251997

    Hey there,

    I am working for a server along with my development team and we are coming accross a error everytime we try and do this. We can not find away around it so we turned to the community for help. Our error is that we are setting a players name to be coloured. Sounds straight forward, we wish. We are having the error where for example we need "xXBlackheadXx" to be bold and yellow yet it is just plain white. Now we are using:
    Code:java
    1. int points = playerstat.getInt("points");
    2. String pointpre = ChatColor.DARK_GRAY + "[" + ChatColor.DARK_AQUA + points + ChatColor.DARK_GRAY + "]";
    3. String name = null;
    4. name = ChatColor.BOLD + "" + ChatColor.YELLOW + p.getName() + ChatColor.RESET;
    5. p.setDisplayName(pointpre + name);

    Now like I said we are trying to set "xXBlackheadXx" to be ChatColor.BOLD and ChatColor.YELLOW yet it does not work. We are using MySQL aswell so we have a global server system so this is needed.

    If anyone has a conclusion please let me know.

    Regards,
    Alex
     
  2. Offline

    RainoBoy97

    AlexHH251997
    You need to add BOLD after you add YELLOW. So ChatColor.YELLOW + ChatColor.BOLD :)
     
  3. Offline

    AlexHH251997

    I am afraid that is not the case. Using BOLD then YELLOW works for us expect people that have names like "xXBlackheadXx". I am wondering if there is some kind of limit on how many characters you can have?
    We still need it to be bold though. Thanks anyway.

    Regards,
    Alex
     
Thread Status:
Not open for further replies.

Share This Page