Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-4441

Reset color code is replaced when retrieving an item's/block's custom name

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • None
    • 1.13.1, I'll get a /version when I get home if needed
    • Yes

      So, I'm not sure if this is intended behavior.

      Steps:

      • give a placed chest block (or other container that's nameable) a custom name via a plugin. Make sure the name contains a reset color code.
      • Print name to chat, or to file for raw output. Observe that the reset color code has turned into ChatColor#BLACK ( §0 ) and prints in chat as such.
      • Break the chest so it turns into an item. Pick up the item. Observe that text after where reset color char was originally inserted is now white.
      • Print out this name in chat or file, Observe that the place the reset color code has turned into ChatColor#WHITE ( §f ) and prints in chat as such.

      This causes issues when attempting to compare a string that has the reset chatcolor included with it - since what I get is the §0 or §f instead of the reset char §r despite using the same string to set the custom name.

            Unassigned Unassigned
            RoboMWM RoboMWM
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: