Uploaded image for project: 'SpigotPlugins'
  1. SpigotPlugins
  2. PLUG-434

I want to simply have my custom recipes available in the recipe book

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Invalid
    • Minor
    • I'm using IntelliJ IDEA CE for a 1.16.5 plugin. The software shouldn't matter for this issue.

    • 1.16.5
    • My recipe plugin
    • Yes

    Description

      (This problem is resolved and you can see my solution in the comments)

       

      This is my first time creating a plugin so please bear with me. I made a plugin that adds custom recipes. How do you get custom recipes to be unlocked by default in the 1.16.5 recipe book for all players? They only unlock when you craft them for the first time.

      Here is an example of one of my added recipes:

      // Protection 1
      ItemStack item = new ItemStack(Material.ENCHANTED_BOOK);
      EnchantmentStorageMeta meta = (EnchantmentStorageMeta) item.getItemMeta();
      
      if (meta != null) {
          meta.addStoredEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 1, false);
          item.setItemMeta(meta);
      
          NamespacedKey key = new NamespacedKey(this, "protection1");
          ShapedRecipe recipe = new ShapedRecipe(key, item)
                  .shape("CBC", "BAB", "CBC")
                  .setIngredient('A', Material.BOOK)
                  .setIngredient('B', Material.IRON_INGOT)
                  .setIngredient('C', Material.IRON_NUGGET);
      
          Bukkit.addRecipe(recipe);
      }

       

      Since this problem is resolved I finally created my first plugin 

      Attachments

        Activity

          People

            Unassigned Unassigned
            Plex EndPlex
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: