ChatColor and fancy characters help

Discussion in 'Spigot Plugin Development' started by dumbninja22, Jun 18, 2015.

Thread Status:
Not open for further replies.
  1. [​IMG]
    How do I do this using player.sendMessage()?

    Ok another question. If I were just doing this:
    ChatColor.STRIKETHROUGH + "" + ChatColor.BOLD + "==========" + "How would I make it so that this text isn't strikethroughed without using ChatColor.RESET?"
     
    #1 dumbninja22, Jun 18, 2015
    Last edited: Jun 18, 2015
  2. sothatsit

    Patron

    It is a special ASCII character. http://www.asciitable.com/
     
  3. So just "p.sendMessage("■■■■■Message■■■■■");"?

    Which character is it exactly (the image)?
     
  4. Why don't you just use the color code symbols?
    Code (Text):
    player.sendMessage("&2&m=")
     
  5. It's just an equals sign repeated, colored green, and strike throu'd.

    Something like: &2&m=========================
     
    • Agree Agree x 1
  6. To be it just looks like
    Code (Text):
    ChatColor.GREEN+ChatColor.BOLD+ChatColor.STRIKETHROUGH+"==================="
    Looks just like what i use as a progress bar in McInfected-Ranks
     
    • Agree Agree x 1
  7. sothatsit

    Patron

    Why should i know? Play around with it and see if it looks like the one in the image.

    Also, if it doesn't let you compile with the extended ASCII characters, it didn't for me, you can do
    Code (Text):
    char block = (char) 254;
    254 being the ascii code of the character.

    Then just do "&2&m" + block + block + block;

    Or
    Code (Text):
    char block = (char) 254;
    StringBuilder builder = new StringBuilder();
    for(int i=0; i < [Number of Blocks]; i++) {
        builder.append(block);
    }

    p.sendMessage(builder.toString() + "Message" + builder.toString());
     
  8. Works but isn't convenient. Have to do translateAltrernateColorCodes.

    Whats the hex code for that (&m=) @itpao25

    OH an equals sign with a strike through is what I want! I think thats it thanks!
     
  9. =================
    an equals sign with a strike through is what I want!
     
  10. I tend to place a translateAlternateColorCodes method inside a static method with a simple name (usually color) and call that with the string I need to color.
     
  11. (some posts later)

     
    • Agree Agree x 1
  12. Ok another question. If I were just doing this:
    ChatColor.STRIKETHROUGH + "" + ChatColor.BOLD + "==========" + "How would I make it so that this text isn't strikethroughed without using ChatColor.RESET?"
     
  13. You can put this in before your text. "§r"
    Yes, I know it's basically ChatColor.RESET but in a different form, but now you don't have to use ChatColor.RESET anymore. ;)
     
  14. Ahhhhh

    Not what I'm looking for. Because then I have to do gold and bold again.
     
  15. Not at home at the moment but I remember finding this weird glitch with ChatColors.
    Tell me if you still get the strike-through on the text with this:
    Code (Text):
    ChatColor.GOLD + "" + ChatColor.STRIKETHROUGH + ChatColor.BOLD + "========" + ChatColor.GOLD + "Your text here"
     
  16. I don't get strike-through on the text, just on the equals signs. Thanks!!!

    If only I understand how it works...
     
  17. Kinda discovered this a while ago.
    This is what I did:
    Code (Text):
    ChatColor.BLUE + ChatColor.BOLD + "string" + "string"
    Now the 1st string was bold and blue, but the 2nd one was only blue but not bold. So for each string you add to the message you have to re-stylize it I guess.
     
  18. ========================================
    OK thx! Problem solved! Reporting thread - requesting lock.

    ========================================
     
    • Funny Funny x 1
Thread Status:
Not open for further replies.