Chat Color Changing Plugin

Discussion in 'Archived: Plugin Requests' started by MacDev, Jun 28, 2014.

  1. Offline



    I have seen some servers use this plugin, but have not found it.

    It changes your chat color with the simple command /color

    For example you may do /color &a, and they now chat in that color, or they can change it and do /color &c, and they now chat in that color.

    If someone knows of this plugin, please post a link or download to it below.

    Details if someone is willing to code one like it:

    Name: ChatColor
    /color (displays the message: Usage: /color <color code> )
    /color <color code> : changes the color the players chat shows in to that color, so they can do /color &a and chat in light green until they change it.
    /color reset : resets their chat color to &f, white.
    /color <player> <color>: Changes the chat color of the specified player to the specified color code. Example: /color notch &a will make 'notch' chat in light green.


    chatcolor.change - allows the user to change their chat color. default:eek:p
    chatcolor.reset - allows the user to reset their chat color. default: op
    chatcolor.others - allows the player to change other players chat color. default: op

    Thank you to anyone who could find a plugin similar to this or generously code one!
  2. Offline


    MacDev Done! <Edit by Moderator: Redacted mediafire url>
    The permissions are chatcolor.change and chatcolor.others! To reset the chatcolor you just do /color &r :) Enjoy! - Jack
    Last edited by a moderator: Nov 2, 2016
    MacDev likes this.
  3. Offline



    Thank you so much for taking your time to make this! It works great!
    TheWolfBadger likes this.
  4. Offline


  5. TheWolfBadger
    I took a look at the source and I saw that it doesn't save the player's chat color. Perhaps MacDev would like something like that?
  6. Offline


    The Gaming Grunts Works the same. Apparently there is no way to actually make a ChatColor variable from a string even with translating alternate color codes. It still works none the less...
  7. Online

    timtower Administrator Administrator Moderator

    TheWolfBadger ChatColor is an enum, enums have names, names are strings, enums have a method valueOf, pretty much string->enum
  8. TheWolfBadger
    You could do something like this if you wanted:

    1. getConfig().set("some.path", "&4");

    Depends on how you want to do it. You could do it with MySQL if you wanted, for example

    UPDATE sometable SET color='&4' WHERE player='someplayer';
  9. Offline


    timtower How would you store it in a HashMap though?
  10. Online

    timtower Administrator Administrator Moderator

    TheWolfBadger this.getConfig().set(uuid.toString(),
  11. Offline


    timtower So how do you get ChatColor from a string? There is no method for it.
  12. Online

    timtower Administrator Administrator Moderator

  13. Offline


    timtower I'll try that out. Tell you how it goes.

    timtower The Gaming Grunts MacDev Ahh fixed! More efficient now!
    <Edit by Moderator: Redacted mediafire url>

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


    TheWolfBadger what causes these errors?

    1. org.bukkit.command.CommandException: Unhandled exception executing command 'color' in plugin ChatColour v1.0
    2. at org.bukkit.command.PluginCommand.execute( ~[craft.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
    3. at org.bukkit.command.SimpleCommandMap.dispatch( ~[craft.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
    4. at org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchCommand( ~[craft.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
    5. at net.minecraft.server.v1_7_R3.PlayerConnection.handleCommand( [craft.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
    6. at net.minecraft.server.v1_7_R3.PlayerConnection.a( [craft.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
    7. at net.minecraft.server.v1_7_R3.PacketPlayInChat.a( [craft.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
    8. at net.minecraft.server.v1_7_R3.PacketPlayInChat.handle( [craft.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
    9. at net.minecraft.server.v1_7_R3.NetworkManager.a( [craft.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
    10. at net.minecraft.server.v1_7_R3.ServerConnection.c(SourceFile:134) [craft.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
    11. at net.minecraft.server.v1_7_R3.MinecraftServer.v( [craft.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
    12. at net.minecraft.server.v1_7_R3.DedicatedServer.v( [craft.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
    13. at net.minecraft.server.v1_7_R3.MinecraftServer.u( [craft.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
    14. at [craft.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
    15. at [craft.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
    16. Caused by: java.lang.IllegalArgumentException: No enum constant org.bukkit.ChatColor.&5
    17. at java.lang.Enum.valueOf(Unknown Source) ~[?:1.7.0_60]
    18. at org.bukkit.ChatColor.valueOf( ~[craft.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
    19. at ~[?:?]
    20. at org.bukkit.command.PluginCommand.execute( ~[craft.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
    21. ... 13 more
  15. Offline


    KenoVincent Try <Edit by Moderator: Redacted mediafire url>
    Last edited by a moderator: Nov 2, 2016
    KenoVincent likes this.
  16. Offline


    TheWolfBadger currently it does'nt creat errors anymore but when I tried to chat still no colors and the "&" are presented with the chat..
  17. Offline


    e.setMessage((String)this.cManager.get(p.getUniqueId()) + "" + e.getMessage());
    here you are just appending the message to the String you get from your map.
    you should do:
    e.setMessage(ChatColor.translateAlternateColorCodes('&',(String)this.cManager.get(p.getUniqueId()) + "" + e.getMessage()));
    Also you are still not saving anything to the config.

    EDIT: Actually this is a bad idea, as it will allow players to use color codes within their messages, which is not what was wanted I think...
    KenoVincent likes this.
  18. Offline


    CGA1123 Oh actually it's bc I tried to change the hashmap to store color codes and it didn't work so I reverted, but I forgot to revert that code back to it's original... Sorry KenoVincent. I will fix when I am on my computer though :)!

    <Edit by Moderator: Redacted mediafire url>

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Nov 2, 2016
    MacDev, CGA1123 and KenoVincent like this.
  19. Offline


    MacDev and TheWolfBadger like this.

Share This Page