Solved undiscoverRecipes

Discussion in 'Plugin Development' started by Yeowza, Feb 24, 2020.

Thread Status:
Not open for further replies.
  1. Offline

    Yeowza

  2. Offline

    bowlerguy66

    @Yeowza After clicking through and reading the doc for the actual NamespacedKey itself I'm guessing you'll use NamespacedKey.minecraft(name of item as string)
     
  3. Offline

    Yeowza

    thanks man, I ended up just clearing all of the recipes and adding my own

    Code:
         
            Bukkit.clearRecipes();
           
            info = new ArrayList<String>();
            info.add("wood.axe");
            info.add("wood.shovel");
           
            ShapelessRecipe woodAxe = new ShapelessRecipe(new NamespacedKey(Main.plugin, "wood.axe"), new ItemStack(Material.WOODEN_AXE, 1));
            List<Material> lm = new ArrayList<Material>(); lm.add(Material.OAK_LOG); lm.add(Material.SPRUCE_LOG); lm.add(Material.BIRCH_LOG);
            woodAxe.addIngredient(new RecipeChoice.MaterialChoice(lm));
            woodAxe.addIngredient(5, Material.STICK);
            woodAxe.addIngredient(1, Material.STRING);
            Bukkit.addRecipe(woodAxe);
           
            ShapelessRecipe woodShovel = new ShapelessRecipe(new NamespacedKey(Main.plugin, "wood.shovel"), new ItemStack(Material.WOODEN_SHOVEL, 1));
            woodShovel.addIngredient(5, Material.STICK);
            woodShovel.addIngredient(1, Material.STRING);
            Bukkit.addRecipe(woodShovel);
     
Thread Status:
Not open for further replies.

Share This Page