Solved Extra Color Line, Help!

Discussion in 'Plugin Development' started by MrMdkrocks, Mar 19, 2014.

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

    MrMdkrocks

    Hello, So I've been learning how to code today and I put this code togeather in a few minutes and I dont know what the problem with this one area is, the color wont add! heres the code:

    "[Welcome]"ChatColor.GREEN + "Welcome to OP-

    Why wouldnt this work?


    Note: That chatcolor is the only thing not working! Without it the plugin works fine, Im just trying to get it to be Green!

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

    adam753

    You add it to the previous string.

    "[Welcome]" + ChatColor.GREEN + "etc"
     
  3. Offline

    canemonster15

    You need to make it "[Welcome]" + ChatColor.GREEN + "Welcome to OP"

    rats. beat me to it

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

    97WaterPolo

    MrMdkrocks
    adam753 said it, you were missing a + sign. The "+" is how they are all added together to form a line in the chat
     
  5. Offline

    Antigrate

    MrMdkrocks

    If you're learning Java today you need to start with simple Java tutorials that aren't bukkit related, because otherwise you're going to do silly things like this. As someone who is also learning Java, starting with the simple tutorials helped me lots.
     
Thread Status:
Not open for further replies.

Share This Page