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:

Colored name in player list

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 and coloredplayernames.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, and coloredplayernames.changecolor.specify.red permission can call /cc red, but they can do this only if either red is available or they have the coloredplayernames.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.

Tab completion

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. If auto-update is set to true, 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. If scoreboard is set to false, 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 the coloredplayernames.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.

Statistics for ColoredPlayerNames


Comments

  • To post a comment, please or register a new account.
Posts Quoted:
Reply
Clear All Quotes

About This Project

Categories

Members

Recent Files