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

Please add the ability to add NBT data such as lore, and display names to recipes.

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Invalid
    • Icon: Minor Minor
    • None
    • None
    • General plugin development / datapacks

    • 1.13 in general
    • none
    • Yes

      It would be amazingly nice to be able to create a recipe with an item result that has the items name / lore set.

       

      For example given this code:

      ItemStack newItem = new ItemStack(Material.IRON_INGOT);
      ItemMeta im = newItem.getItemMeta();
      im.setDisplayName("My Customized Item");
      //set lore and other stuff
      is.setItemMeta(im);
      
      		ShapedRecipe sr = new ShapedRecipe(new NamespacedKey(MyExampleCode.getPlugin(), "CustomNamedItem"), newItem);
      		sr.shape("iii","lhi","iti");
      		
      		sr.setIngredient('i', Material.IRON_INGOT);
      		sr.setIngredient('l', Material.LEVER);
      		sr.setIngredient('h', Material.HOPPER);
      		sr.setIngredient('t', Material.TRIPWIRE_HOOK);
      //It would be also fine if you could just add the meta to be added to the end material in here as well:
      // sr.setResultDisplayName("My Customized Item");
      // sr.setResultLore(<some lore>);
      		MyExampleCode.getPlugin().getServer().addRecipe(sr);
      

      Ideally the data would carry over when the components were all placed in the crafting grid, the new customized item with its display name and lore would be set and show up in the result slot.     Finally, if these could carry over to datapack recipes we could even have the customized item show up in the recipe book.

      Thank you

        1. F9szDHI.png
          13 kB
          md_5
        2. QN82lcC.png
          53 kB
          md_5
        3. rvTnQbh.png
          33 kB
          md_5

            Unassigned Unassigned
            whoolieshop Shane Martin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: