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

Increase item text length limits

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Version:
      1.16.1
    • Guidelines Read:
      Yes

      Description

      Full server version from the logs:

      This server is running CraftBukkit version git-Spigot-d4cbb64-2361cb8 (MC: 1.16.1) (Implementing API version 1.16.1-R0.1-SNAPSHOT)

       

      I have noticed that sometimes, when I set an item's display name to something fancy with color codes, the name is not rendered at all and instead replaced with the item's default name in minecraft. Here is an example:

       

      meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', 
                  "&e&l<&r&e&l&6 ✦ &r&e&l>&m= &e&l&m &r   &7&lSword"));
      stack.setItemMeta(meta);
      

      Results in an item with this name: 

      meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', 
                  "&7&lSword&f   &r&e&l&m &r&e&l&m =&e&l<&r&e&l&6 ✦ &r&e&l>"));
      stack.setItemMeta(meta);
      

      Results in:

      But if I try to do both sides of the word "Sword":

      meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', 
                  "&e&l<&r&e&l&6 ✦ &r&e&l>&m= &e&l&m &r   &7&lSword&f   &r&e&l&m &r&e&l&m =&e&l<&r&e&l&6 ✦ &r&e&l>"));
      stack.setItemMeta(meta);
      

      This happens:

       

       

      This is the faulty item's json looks like this:

      {id:"minecraft:light_gray_concrete",Count:1b,tag:{HideFlags:63,display:{Name:'{"extra":[{"bold":true,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"yellow","text":"<"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"gold","text":" ✦ "},{"bold":true,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"yellow","text":">"},{"bold":true,"italic":false,"underlined":false,"strikethrough":true,"obfuscated":false,"color":"yellow","text":"= "},{"bold":true,"italic":false,"underlined":false,"strikethrough":true,"obfuscated":false,"color":"yellow","text":" "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"text":" "},{"bold":true,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"gray","text":"Sword"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"white","text":" "},{"bold":true,"italic":false,"underlined":false,"strikethrough":true,"obfuscated":false,"color":"yellow","text":" "},{"bold":true,"italic":false,"underlined":false,"strikethrough":true,"obfuscated":false,"color":"yellow","text":" ="},{"bold":true,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"yellow","text":"<"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"gold","text":" ✦ "},{"bold":true,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"yellow","text":">"}],"text":""}'}}}
      

       

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            Blocky Martin Borzan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: