1

A Quick Bukkit Question

FirecatHD 11/12/13 8:18 am
156
11/13/2013 12:08 pm
OK, i dont know if i can post these kind of things here, but idk where then.

I am just wondering how you have multiple (ChatColor.COLOR) codes in one line, aka change the colors from one to another.

This is the code i came up with, but it wont work so i hope someone know the answer

Link: http://pastebin.com/6JBjvXzk

Thanks in advance!
Posted by
FirecatHD
Level 23 : Expert Ninja
17

  Have something to say?

JoinSign in

4

oggehej
11/12/2013 11:36 am
Level 18 : Journeyman Toast
Do like p.sendMessage(ChatColor.YELLOW + "You equipped " + ChatColor.INDIGO + "Basic! " + ChatColor.GREY + "Its balanced, but yet strong");
It should work just fine.

Just simply put a + between words and the ChatColor, rather than )( that will try to close (and open) the parameter.
1
FirecatHD
11/12/2013 11:56 am
Level 23 : Expert Ninja
I just figured it out, but thanks anyways
1
Rogue
11/13/2013 12:08 pm
Level 12 : Journeyman Crafter
Alternatively, have a colorization method, then you can apply it whenever you want colors and just use the ampersand for color-code adding.

public String __(String encoded) {
return ChatColor.translateAlternateColorCodes('&', encoded);
}

//...
Player.sendMessage(__("This is in &ccolor!"));
1
FirecatHD
11/12/2013 8:55 am
Level 23 : Expert Ninja
Anyone?
1

Welcome