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

setLocalizedName yielded incorrect meta data.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • None
    • None
    • 1.16.5-RO-1
    • Yes

      Code used to generate the item (test plugin available)

      private static void giveitem1() {
          ItemStack item = new ItemStack(Material.STONE, 1);
          ItemMeta meta = item.getItemMeta();
          meta.setLocalizedName("REEEE.WORKK");
          item.setItemMeta(meta);
          number1 = item;
      }
      

       

      Expected result.

      {display: {Name: '{"translate":"REEEE.WORKK"}'}}
      

       

      Meta data result.

      {display: {LocName: '{"extra":[{"clickEvent":{"action":"open_url","value":"http://REEEE.WORKK"},"text":"REEEE.WORKK"}],"text":""}'}}
      

      Minecraft client don't recognize the meta data generated from the api and display vanilla name.

       

      note: I inspected meta data by holding the item and execute vanilla command "/data get entity @s SelectedItem.tag"
      note2: You can change "REEEE.WORKK" to "gui.recipebook.search_hint" which if the meta data is generated correctly it will display item name as "Search...", anything else is incorrect

            Unassigned Unassigned
            playbabe playbabeTheBookShelf
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: