ColoredPlayerNames
What is ColoredPlayerNames?
ColoredPlayerNames is a very simple plugin. On join, a player's username is changed to a random color. Here's an example screenshot:
Where does my colored name show up?
This plugin changes names (almost) everywhere they are seen:
- Join message
- Death message
- Leave message
- Chat
- Above heads
- Player list
How do I change the color of my name?
The color of your name is determined randomly when you join the server. If you have an undesirable color (for example, the darker colors can be hard to read), you can simply reconnect to the server. The next time you join, a different color will be randomly selected.
Players can also change their color with the /changecolor
command, or you can configure certain players to be permanently set to specific colors.
How do I use ColoredPlayerNames?
ColoredPlayerNames is really simple to use. Just add it to your plugins folder and start up your server; any new player who joins will have their name automatically changed. All configuration, commands, and permissions are optional.
Commands
changecolor
The /changecolor
command allows you to change your own color. There are two ways it can be used:
/changecolor
– randomly picks a new color for you/changecolor <color>
– sets your color to the specified color
An alias of this command is /cc
. Here are some example usages:
- A player who has the
coloredplayernames.color
andcoloredplayernames.changecolor
permissions can call/cc
to change their color to a random new one. The color will be chosen from the ones in the configuration, where the probability of a color being chosen is proportional to its weight. - A player who has the
coloredplayernames.color
,coloredplayernames.changecolor
, andcoloredplayernames.changecolor.specify.red
permission can call/cc red
, but they can do this only if eitherred
is available or they have thecoloredplayernames.changecolor.force
permission.
coloredplayernames
The coloredplayernames
command allows you to administrate the coloredplayernames plugin. There are three ways it can be used:
/coloredplayernames reload
– reloads the configuration and recolors any online players/coloredplayernames set <player> <color>
– sets a player's static color to the one specified and saves the updated configuration/coloredplayernames unset <player>
– removes a player's static color and saves the updated configuration
An alias of this command is /cpn
. Here are some usage examples:
- You want to make changes to the ColoredPlayerNames configuration without restarting the server. You modify the configuration file and save it, then run
/cpn reload
to enact your changes. - You have a VIP on your server with the username
jeb_
. To make this clear to the players on your server, you want to make it so that his name is always underlined. To do this without modifying your configuration file, you can call/cpn set jeb_ underline
. - You no longer want
jeb_
to have an underlined name. Instead, you want his name to be randomly colored like everyone else. You can call/cpn unset jeb_
to make this change.
Tab Completion
All of the commands have tab completion, so ColoredPlayerNames should be very easy to use for players on your server.
Configuration
Most configuration for ColoredPlayerNames is done through config.yml file. If you'd like to regenerate the default config, you can delete your current config and the default one will be generated. Here's the default config:
# ColoredPlayerNames config.yml auto-update: true scoreboard: true colors: black: weight: 0.2 aliases: - dark dark_blue: name: dark blue weight: 0.5 aliases: - navy dark_green: name: dark green weight: 0.5 dark_aqua: name: dark aqua weight: 0.5 aliases: - dark cyan - dark tuquoise dark_red: name: dark red weight: 0.5 aliases: - maroon dark_purple: name: dark purple weight: 0.5 aliases: - dark magenta - dark violet - violet gold: weight: 0.5 aliases: - dark yellow - orange gray: weight: 0.2 aliases: - grey - light gray - light grey dark_gray: name: dark gray weight: 0.2 aliases: - dark grey blue: weight: 1.0 aliases: - light blue green: weight: 1.0 aliases: - light green aqua: weight: 1.0 aliases: - cyan - light aqua - light cyan - light turquoise - turquoise red: weight: 1.0 aliases: - light red light_purple: name: light purple weight: 1.0 aliases: - magenta - pink - purple yellow: weight: 1.0 aliases: - light yellow white: weight: 0.2 aliases: - light obfuscated: aliases: - magic bold: aliases: - heavy - thick strikethrough: aliases: - crossed out underline: aliases: - underlined italic: aliases: - italicized - italics players: jeb_: obfuscated
Here's a description of what each of the options does:
auto-update
- Whether the plugin will automatically update itself. Ifauto-update
is set totrue
, then ColoredPlayerNames will automatically update itself each time the server is started.scoreboard
- Whether the scoreboard system should be used to color names. This plugin uses the system to color names above heads. This will cause issues if you are using another plugin that uses the scoreboard system. Ifscoreboard
is set tofalse
, then names will not be colored above heads but the plugin will be compatible with scoreboard-based plugins.colors
- All of the colors available for player names. Each section should be named with the official names listed in the default configuration. Technically, this includes not only colors, but formats as well. You can read more about formatting codes on the Minecraft Wiki.name
- The name used for this color throughout the plugin. Spaces are allowed. If not specified, the official name (the name of the configuration section) is used.weight
- This color's weight in the random selection. When a color is randomly selected, each color has a probability proportional to its weight. If you don't specify a weight, a weight of zero is assumed, meaning that the color cannot be randomly selected.aliases
- A list of alternative names for the color. These aliases can be used in commands in place of the name.
players
- Static colors for players that don't randomly change. If a player is specified here, then their color will always be whatever is specified. In the example,jeb_
will always be obfuscated. Note that when the configuration is loaded by the server, this section will be modified to include UUIDs so that it will not need to be reconfigured when players change their names.
Permissions
Permissions are completely optional, and the default permissions are reasonable. Here's a list of all available permissions:
coloredplayernames.color
- Allows a player's name to be colored. By default, everyone has this permission.coloredplayernames.changecolor
- Allows use of the/changecolor
command. By default, everyone has this permission.coloredplayernames.changecolor.specify.<color>
(where<color>
is the official name of a color or format) - Allows a player to specify the given color when using the/changecolor
command. For example, give a player thecoloredplayernames.changecolor.specify.light_purple
permission to grant them access to the/changecolor light purple
command. By default, everyone is allowed to specify non-format colors, but only server operators allowed to specify formatting codes.coloredplayernames.changecolor.specify.*
- Allows a player to specify any color or format when using the/changecolor
command. By default, only server operators have this permission.coloredplayernames.changecolor.force
- Allows a player to force their change of color, even if the color is unavailable. If a player does not have this permission, then they will be unable to set their color to one in use by another player (unless all colors are in use). By default, only server operators have this permission.coloredplayernames.admin
- Allows use of the/coloredplayernames
command. By default, only server operators have this permission.
Is this plugin compatible with other plugins?
You may have to make some configuration changes to ensure that this plugin is compatible with your other ones.
Scoreboard system
ColoredPlayerNames uses the scoreboard system to color names above heads. However, you may want to use the scoreboard system for other purposes, like server minigames. If this is the case, you should set scoreboard: false
in the configuration, which will make it so that names are not colored above heads.
Custom prefixes or nicknames
ColoredPlayerNames overwrites each player's "display name" with a colored version. You may be using another plugin to give certain players custom prefixes or nicknames. If you would like a certain player's name to be uncolored, make sure that they do not have the coloredplayernames.color
permission.
Updater and bStats
I use Updater to automatically update this plugin. You can opt-out from Updater by setting auto-update: false
in the configuration.
I also use bStats to track statistics about the usage of this plugin. This will create a bStats/config.yml file in your plugins directory. You can set enabled: false
in this file to opt-out of bStats.
Neither of these services are harmful to your server, and no intrusive or identifiable data is collected from your server. Please only opt-out of these services if you have a good reason.
Source
This project's source is available on GitHub.
how do i make it so it is not random when I join?
Hi , is there any way to remove these two <> signs form a player's name in chat which this plugin makes them? example : <player>
After downloading the plugin on the tab, players had colored nicknames but all players had null nicknames on the chat. After removing the plugin it did nothing. How can I make players not called null in chat?
Does this still work on 1.15.2?
Hey there, am I able to change it so that only Server Operators can set the colours? If so, let me know about how I can go about doing this
- many thanks
The player Name dosent change in the game (the chat color works)
picture: https://mega.nz/#!TvJSQATY!vCYahcDczmTbTF_Viqj4GEze00q2C_PHqMHUMpZaK5k
Is there a way to set the default as gray? i tried to set the other colors weight to 0.0 still didnt work. it changes it to white
In reply to Forge_User_33094999:
That's strange. Could you send you your config (through pastebin or something)? Also, ensure that everyone has the
coloredplayernames.color
permission (which everyone should have by default).Is there a way to set my name to dark red and underlined?
In reply to Amurity:
Good question. Unfortunately, the Minecraft scoreboard system does not allow this.
How can I choose the yellow color as the default color for everyone in the server without doing /coloredplayernames set <player> yellow to everyone?
And how can I remove the perm of /cc <color>?
In reply to fonexte:
There is currently no ability to set a "default" color that all players start as, but I might add this feature if there's interest. However, there is a workaround:
If you'd like to set all (except permitted) players to yellow and restrict their ability to change their color, you could set the weight of every non-yellow color to
0.0
. Note however, that this will make it so that any player who runs the/cc
command (with no arguments) will be set to yellow. Permitted players will still be able to specify colors with the/cc <color>
command, but whenever a color is "randomly" selected, it will be yellow.The permission to specify a color with the
/cc <color>
command is granted by thecoloredplayernames.changecolor.specify.<color>
permissions. By default, all players have these permissions for non-format colors. You can remove these permissions to restrict this ability.
In reply to finnv3:
And can you add an option to set a color as the default color and the ability not to allow default players use /cc commands? It is to set all default players as white color and staff as other color.
Hey everyone, the bug reported by Tankypanda and MissileMann should be fixed now in version 2.0.2, so please update. Let me know if you have any more issues!
I just installed this plugin and the command works fine but I get the error message:
An internal error occurred while attempting to perform this command
I am currently running an online server.
In reply to Forge_User_06484260:
Sorry about that and thanks for letting me know. Are there any error messages in the console? If so, could you send me the full stack trace?
In reply to finnv3:
I'm getting the same error. This is my console output on my server after I use the command:
31.05 15:08:24 [Server] Server thread/INFO MissileMann issued server command: /cc green 31.05 15:08:24 [Server] Server thread/ERROR null 31.05 15:08:24 [Server] INFO org.bukkit.command.CommandException: Unhandled exception executing command 'cc' in plugin ColoredPlayerNames v2.0 31.05 15:08:24 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[spigot-1.14.2.jar:git-Spigot-093165d-cb3d14c] 31.05 15:08:24 [Server] INFO at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[spigot-1.14.2.jar:git-Spigot-093165d-cb3d14c] 31.05 15:08:24 [Server] INFO at org.bukkit.craftbukkit.v1_14_R1.CraftServer.dispatchCommand(CraftServer.java:707) ~[spigot-1.14.2.jar:git-Spigot-093165d-cb3d14c] 31.05 15:08:24 [Server] INFO at net.minecraft.server.v1_14_R1.PlayerConnection.handleCommand(PlayerConnection.java:1670) ~[spigot-1.14.2.jar:git-Spigot-093165d-cb3d14c] 31.05 15:08:24 [Server] INFO at net.minecraft.server.v1_14_R1.PlayerConnection.a(PlayerConnection.java:1510) ~[spigot-1.14.2.jar:git-Spigot-093165d-cb3d14c] 31.05 15:08:24 [Server] INFO at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(PacketPlayInChat.java:47) ~[spigot-1.14.2.jar:git-Spigot-093165d-cb3d14c] 31.05 15:08:24 [Server] INFO at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(PacketPlayInChat.java:1) ~[spigot-1.14.2.jar:git-Spigot-093165d-cb3d14c] 31.05 15:08:24 [Server] INFO at net.minecraft.server.v1_14_R1.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:13) ~[spigot-1.14.2.jar:git-Spigot-093165d-cb3d14c] 31.05 15:08:24 [Server] INFO at net.minecraft.server.v1_14_R1.TickTask.run(SourceFile:18) [spigot-1.14.2.jar:git-Spigot-093165d-cb3d14c] 31.05 15:08:24 [Server] INFO at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeTask(SourceFile:135) [spigot-1.14.2.jar:git-Spigot-093165d-cb3d14c] 31.05 15:08:24 [Server] INFO at net.minecraft.server.v1_14_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) [spigot-1.14.2.jar:git-Spigot-093165d-cb3d14c] 31.05 15:08:24 [Server] INFO at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeNext(SourceFile:114) [spigot-1.14.2.jar:git-Spigot-093165d-cb3d14c] 31.05 15:08:24 [Server] INFO at net.minecraft.server.v1_14_R1.MinecraftServer.aW(MinecraftServer.java:895) [spigot-1.14.2.jar:git-Spigot-093165d-cb3d14c] 31.05 15:08:24 [Server] INFO at net.minecraft.server.v1_14_R1.MinecraftServer.executeNext(MinecraftServer.java:888) [spigot-1.14.2.jar:git-Spigot-093165d-cb3d14c] 31.05 15:08:24 [Server] INFO at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.awaitTasks(SourceFile:123) [spigot-1.14.2.jar:git-Spigot-093165d-cb3d14c] 31.05 15:08:24 [Server] INFO at net.minecraft.server.v1_14_R1.MinecraftServer.sleepForTick(MinecraftServer.java:872) [spigot-1.14.2.jar:git-Spigot-093165d-cb3d14c] 31.05 15:08:24 [Server] INFO at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:805) [spigot-1.14.2.jar:git-Spigot-093165d-cb3d14c] 31.05 15:08:24 [Server] INFO at java.lang.Thread.run(Thread.java:748) [?:1.8.0_191] 31.05 15:08:24 [Server] INFO Caused by: java.lang.IllegalArgumentException: Team name '__CPN__MissileMann' is longer than the limit of 16 characters 31.05 15:08:24 [Server] INFO at org.apache.commons.lang.Validate.isTrue(Validate.java:136) ~[spigot-1.14.2.jar:git-Spigot-093165d-cb3d14c] 31.05 15:08:24 [Server] INFO at org.bukkit.craftbukkit.v1_14_R1.scoreboard.CraftScoreboard.registerNewTeam(CraftScoreboard.java:166) ~[spigot-1.14.2.jar:git-Spigot-093165d-cb3d14c] 31.05 15:08:24 [Server] INFO at com.voichick.cpn.PlayerColors.set(PlayerColors.kt:69) ~[?:?] 31.05 15:08:24 [Server] INFO at com.voichick.cpn.ChangeColorExecutor.onCommand(ChangeColorExecutor.kt:47) ~[?:?] 31.05 15:08:24 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-1.14.2.jar:git-Spigot-093165d-cb3d14c] 31.05 15:08:24 [Server] INFO ... 17 more
In reply to MissileMann:
Thanks! I’ve discovered the issue: I'm trying to create a team with a name longer than 16 characters, which the scoreboard system doesn’t allow. I'm setting the team names to
__CPN__<username>
, and I didn't catch it in testing because the usernames I was testing were shorter and so it didn't end up going over the 16 character limit. I'll try to post a fix to this today, or in the next week. In the meantime, you can setscoreboard: false
in the config to disable the scoreboard system, though this will remove colors above heads.I'm using spigot 1.14.1 and I'm getting this error:
org.bukkit.configuration.InvalidConfigurationException: Unrecognized name: jeb_
In reply to Forge_User_89612795:
Sorry about that. Are you running the server in offline mode? I don't think that I'm correctly handling offline mode servers at the moment (because I'm getting UUIDs from usernames, which requires the server to be in online mode). I'll post a fix for this in the next few days. In the meantime, I think a workaround would be to set
players: {}
in config.yml. Let me know if this works.