Patbox / StyledNicknames

Simple, but configurable nicknaming mod allowing your server's players (and admins) to change their nickname with full formatting support
GNU Lesser General Public License v3.0
12 stars 8 forks source link

Allow custom hex colors in nicknames #15

Closed Treeways closed 1 year ago

Treeways commented 1 year ago

Minecraft legacy color codes work fine with custom nicknames. However, I would like these hex colors to work too.

Codes generated from this site do not seem to work, even with the gradients option set to true:

image

Treeways commented 1 year ago

My config is quite unrestrictive:

{
  "CONFIG_VERSION_DONT_TOUCH_THIS": 1,
  "_comment": "Before changing anything, see https://github.com/Patbox/StyledNicknames#configuration",
  "allowByDefault": true,
  "nicknameFormat": "${nickname}",
  "maxLength": 500,
  "changeDisplayName": true,
  "changePlayerListName": true,
  "allowLegacyFormatting": true,
  "nicknameChangedMessage": "Your nickname has been changed to ${nickname}",
  "nicknameResetMessage": "Your nickname has been removed!",
  "defaultEnabledFormatting": {
    "dark_red": true,
    "color": true,
    "underline": true,
    "yellow": true,
    "hard_gradient": true,
    "italic": true,
    "dark_blue": true,
    "dark_purple": true,
    "gold": true,
    "red": true,
    "aqua": true,
    "hover": true,
    "gray": true,
    "light_purple": true,
    "white": true,
    "dark_gray": true,
    "strikethrough": true,
    "obfuscated": true,
    "change_page": true,
    "green": true,
    "dark_green": true,
    "gradient": true,
    "black": true,
    "bold": true,
    "rainbow": true,
    "blue": true,
    "dark_aqua": true,
    "reset": true
  },
  "tooLongMessage": "This nickname is too long!"
}
Treeways commented 1 year ago

The solution is to not place chat content in tags, and to separate them out, like so:

/nick set <#FF00FF>Test <#FFFF00>Nick