ColoredPlayerNames 是什么?
ColoredPlayerNames 是一个非常简单的插件。玩家加入服务器时,其用户名会被随机更改为一种颜色。以下是一张示例截图:
我的彩色名字会显示在哪里?
该插件会在(几乎)所有显示名称的地方更改名字:
- 加入消息
- 死亡消息
- 离开消息
- 聊天栏
- 头顶上方
- 玩家列表
如何更改我的名字颜色?
你的名字颜色在加入服务器时是随机确定的。如果你不喜欢当前的颜色(例如,较深的颜色可能难以阅读),只需重新连接服务器即可。下次加入时,将随机选择另一种颜色。
玩家也可以通过 /changecolor 命令来更改颜色,或者你可以配置某些玩家永久设置为特定颜色。
如何使用 ColoredPlayerNames?
ColoredPlayerNames 的使用非常简单。只需将其添加到你的 plugins 文件夹并启动服务器;任何新加入的玩家都会自动更改名字颜色。所有配置、命令和权限都是可选的。
命令
changecolor
/changecolor 命令允许你更改自己的颜色。有两种使用方式:
/changecolor – 为你随机选择一个新的颜色
/changecolor <color> – 将你的颜色设置为指定的颜色
此命令的一个别名是 /cc。以下是一些使用示例:
- 拥有
coloredplayernames.color 和 coloredplayernames.changecolor 权限的玩家可以使用 /cc 将自己的颜色更改为随机的新颜色。颜色将从配置中选择,选中某种颜色的概率与其权重成正比。
- 拥有
coloredplayernames.color、coloredplayernames.changecolor 和 coloredplayernames.changecolor.specify.red 权限的玩家可以使用 /cc red,但前提是 red 可用,或者他们拥有 coloredplayernames.changecolor.force 权限。
coloredplayernames
coloredplayernames 命令允许你管理 coloredplayernames 插件。有三种使用方式:
/coloredplayernames reload – 重新加载配置并为所有在线玩家重新着色
/coloredplayernames set <player> <color> – 将玩家的静态颜色设置为指定颜色,并保存更新后的配置
/coloredplayernames unset <player> – 移除玩家的静态颜色,并保存更新后的配置
此命令的一个别名是 /cpn。以下是一些使用示例:
- 你想在不重启服务器的情况下修改 ColoredPlayerNames 的配置。你修改了配置文件并保存,然后运行
/cpn reload 以应用更改。
- 你的服务器上有一个用户名为
jeb_ 的 VIP 玩家。为了让其他玩家清楚这一点,你希望他的名字始终带有下划线。要在不修改配置文件的情况下实现这一点,你可以调用 /cpn set jeb_ underline。
- 你不再希望
jeb_ 的名字带有下划线。相反,你希望他的名字像其他人一样随机着色。你可以调用 /cpn unset jeb_ 来实现这一更改。
Tab 补全
所有命令都支持 Tab 补全,因此 ColoredPlayerNames 对于你服务器上的玩家来说应该非常容易使用。
配置
ColoredPlayerNames 的大多数配置都是通过 config.yml 文件完成的。如果你想重新生成默认配置,可以删除当前配置文件,系统将自动生成默认配置。以下是默认配置:
# 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
以下是每个选项的功能说明:
auto-update - 插件是否会自动更新自身。如果将 auto-update 设置为 true,则每次服务器启动时 ColoredPlayerNames 都会自动更新。
scoreboard - 是否使用记分板系统来为名称着色。本插件利用该系统为头顶上方的名称着色。如果您正在使用其他基于记分板系统的插件,这可能会导致问题。如果将 scoreboard 设置为 false,则头顶上方的名称将不会着色,但插件将与基于记分板的插件兼容。
colors - 玩家名称可用的所有颜色。每个部分应使用默认配置中列出的官方名称进行命名。从技术上讲,这不仅包括颜色,还包括格式。您可以在 Minecraft Wiki 上阅读有关格式化代码的更多信息。
name - 插件中用于此颜色的名称。允许包含空格。如果未指定,则使用官方名称(即配置部分的名称)。
weight - 该颜色在随机选择中的权重。当随机选择一种颜色时,每种颜色被选中的概率与其权重成正比。如果您未指定权重,则假定为零权重,意味着该颜色无法被随机选中。
aliases - 该颜色的替代名称列表。这些别名可以在命令中代替名称使用。
players - 不随机更改的玩家的静态颜色。如果在此处指定了玩家,则他们的颜色将始终是指定的值。在示例中,jeb_ 将始终是混淆样式。请注意,当服务器加载配置时,此部分将被修改以包含 UUID,以便在玩家更改名称时无需重新配置。
权限
权限完全是可选的,且默认权限设置合理。以下是所有可用权限的列表:
coloredplayernames.color - 允许为玩家名称着色。默认情况下,所有人都有此权限。
coloredplayernames.changecolor - 允许使用 /changecolor 命令。默认情况下,所有人都有此权限。
coloredplayernames.changecolor.specify.<color>(其中 <color> 是颜色或格式的官方名称)- 允许玩家在运行 /changecolor 命令时指定给定颜色。例如,授予玩家 coloredplayernames.changecolor.specify.light_purple 权限,即可让他们使用 /changecolor light purple 命令。默认情况下,所有人都可以指定非格式颜色,但只有服务器操作员可以指定格式化代码。
coloredplayernames.changecolor.specify.* - 允许玩家在运行 /changecolor 命令时指定任何颜色或格式。默认情况下,只有服务器操作员拥有此权限。
coloredplayernames.changecolor.force - 允许玩家强制更改颜色,即使该颜色不可用。如果玩家没有此权限,则他们无法将自己的颜色设置为其他玩家正在使用的颜色(除非所有颜色都已被占用)。默认情况下,只有服务器操作员拥有此权限。
coloredplayernames.admin - 允许使用 /coloredplayernames 命令。默认情况下,只有服务器操作员拥有此权限。
此插件与其他插件兼容吗?
您可能需要进行一些配置更改,以确保此插件与您其他的插件兼容。
记分板系统
ColoredPlayerNames 使用记分板系统为头顶上方的名称着色。但是,您可能希望出于其他目的(如服务器小游戏)使用记分板系统。如果是这种情况,您应该在配置中设置 scoreboard: false,这将使头顶上方的名称不再着色。
自定义前缀或昵称
ColoredPlayerNames 会用着色版本覆盖每个玩家的“显示名称”。您可能正在使用其他插件为某些玩家提供自定义前缀或昵称。如果您希望某个特定玩家的名称不被着色,请确保他们没有 coloredplayernames.color 权限。
更新器与 bStats
我使用 Updater 来自动更新此插件。您可以通过在配置中设置 auto-update: false 来选择退出 Updater。
我还使用 bStats 来跟踪关于此插件使用情况的统计数据。这将在您的 plugins 目录中创建一个 bStats/config.yml 文件。您可以在该文件中设置 enabled: false 来选择退出 bStats。
这两项服务都不会对您的服务器造成危害,并且不会从您的服务器收集任何侵入性或可识别的数据。只有在有充分理由的情况下,才请选择退出这些服务。
源代码
此项目的源代码可在 GitHub 上找到。
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 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.
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.
评论 0
登录后参与评分
还没有评论,来抢沙发吧