Development Assistance Public String Prefix

Discussion in 'Plugin Help/Development/Requests' started by M&R Coding, May 29, 2015.

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

    M&R Coding

    So I have created a public string prefix and in game the PSP is in white rather than in colour?
    =====================================
    public String prefix = "&8[&bTeams&8]&r ";
    =====================================
    Thats the code (Without the ='s). When it is in game it has all the symbols and just simply looks like this -
    http://gyazo.com/3f70c660335f16ebb8052e1d09c9cf98

    If anyone knows how to fix this it would really help!
    Thanks
    - Matt
     
  2. Offline

    timtower Administrator Administrator Moderator

    @M&R Coding ChatColor.translateAlternateColorCode('&',string)
     
  3. Offline

    M&R Coding

  4. Offline

    timtower Administrator Administrator Moderator

    @M&R Coding And what is the code that you are using?
     
  5. Offline

    M&R Coding

    public String prefix = "&8[&bTeams&8]&r ";
    String toTranslate = "&8[&bTeams&8]&r ";

    ((Player)sender).sendMessage(this.prefix + ChatColor.translateAlternateColorCodes('&', toTranslate) + "Teams is not currently available!"); //The Message Sent To The Player
     
  6. Offline

    I Al Istannen

    @M&R Coding To me it looks like everything is working correctly. The String you give the ChatColor method translates correctly. You never pass your prefix to the translate method though. Try setting your prefix already colored, like (pseudo code):
    "prefix = translate("&8[&bTeams&8]&r ")"
     
  7. Offline

    timtower Administrator Administrator Moderator

Thread Status:
Not open for further replies.

Share This Page