Solved § sign not working for Chatcolor

Discussion in 'Plugin Development' started by StealWonders, Jul 31, 2015.

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

    StealWonders

    Why does the "§" symbol not work for my bukkit plugin? When a text which is supposed to have color it outputs a "?" and then the text. 2015-07-31_21.44.15.png
     
  2. Offline

    MrBlackIsBack

    Use the ChatColor enum.
     
  3. Offline

    FisheyLP

    You need to save the java files as UTF-8 or it may not work properly
    or use the ChatColor enums
    or ChatColor.translateAlternateColorCodes('&', "&8[&aLogo&8] &7Das ist irgendein text")
     
  4. Offline

    SuperOriginal

    Or just use ChatColor.color
     
    bwfcwalshy likes this.
  5. Offline

    PDKnight

    Use this function in your code:
    Code:java
    1. public String parseColors(String s) {
    2. return s.replace("§", "\u00a7");
    3. }

    And then use it in your code like this:
    Code:java
    1. player.sendMessage(parseColors("§aBeautiful colors §f§l:D"));
     
  6. Offline

    StealWonders

    Thanks! Intellj doesn't do this auto.... What a bummer :)
     
  7. Offline

    SuperOriginal

     
Thread Status:
Not open for further replies.

Share This Page