Solved ChatColor Help

Discussion in 'Plugin Development' started by WhaleAnarchy, Oct 5, 2013.

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

    WhaleAnarchy

    Hello again Bukkit,

    I have a small problem that I can't seem to find anywhere on the bukkit.org website (or anywhere else for that matter), I have seen this in many plugins but can't seem to do this. Use a ChatColor.Color WITH a ChatColor.BOLD, I know this might seem stupid and pathetic and some of you are probably thinking and saying "IS THIS PERSON AN IDIOT?!", well I can answer that with one simple word, yes.

    An example if you don't understand what I am asking:
    Code:java
    1. player.sendMessage(ChatColor.GREEN + ChatColor.BOLD + "Hello Bukkit");


    If someone can help me with this problem that I have I would be VERY, VERY grateful!

    - WhaleAnarchy
     
  2. Offline

    adam753

    That code should work. What's wrong with it?
     
  3. Offline

    harrysbird

    Please give me a main code
     
  4. Offline

    JRL1004

    I ran into a problem like this a while back. A quick and easy way to fix it is to change the line to this:
    Code:java
    1. player.sendMessage(ChatColor.GREEN + "" + ChatColor.BOLD + "Hello Bukkit");

    For some reason ChatColor does not like to be added one after the other
     
  5. Offline

    WhaleAnarchy

    adam753 It says "The operator + is undefined for the argument type".

    And harrysbird why the hell do you need my code, I gave it all at the top of my post xD

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
  6. Offline

    adam753

    WhaleAnarchy
    That means you can't add two ChatColor enums together, you can only add them to strings. So what JRL1004 said.
     
  7. Offline

    harrysbird

    post your server log


    Because it easy to fix a error
     
  8. Offline

    sgavster

    Try:
    Code:java
    1. player.sendMessage("§2§lHello Bukkit");
     
  9. Offline

    WhaleAnarchy

    Thanks adam753, this has been plaguing my for a while xD

    And sgavster, I don't use the "§" symbol because I don't have it readily available at the drop of a hat.
     
  10. Offline

    harrysbird

    mark thread to solved
     
  11. Offline

    sgavster

    WhaleAnarchy If you have windows you just hold down alt and press 2 then 1 :p

    harrysbird why are you talking in bold

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
  12. Offline

    adam753

    sgavster Because he wants to sound important even though he was no help
     
Thread Status:
Not open for further replies.

Share This Page