1 Ingredient Custom Crafting?

Discussion in 'Plugin Development' started by Heirteir, Mar 26, 2014.

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


    How would I go about doing this but with 1 ingredient, because this doesn't working.

    1. ShapedRecipe Sugar_Recipe = new ShapedRecipe(new ItemStack(Sugar));
    2. Sugar_Recipe.shape(new String[] {"CCC", "ICI", "III"});
    3. Sugar_Recipe.setIngredient('I', Material.AIR);
    4. Sugar_Recipe.setIngredient('C', Material.SUGAR);
    5. Bukkit.getServer().addRecipe(Sugar_Recipe);
  2. Heirteir
    I don't understand... Why do you want to craft sugar with sugar?

    Anyway try this:
    1. ShapelessRecipe recipe = new ShapelessRecipe(new ItemStack(Material.SUGAR, 1));
    2. recipe.addIngredient(Material.SUGAR);
    3. this.getServer().addRecipe(recipe);

    If you have only 1 ingredient, you don't have to use ShapedRecipe, you can use ShapelessRecipe it's better because you can craft in inventory too.
  3. Offline


    I need it for a drug plugin I am working on
  4. Offline


    Your title says "1 ingredient" but your current recipe requires 4 sugar.
    Maybe is this the problem?
  5. Offline


    Don't use air, just put a space for blank slots
Thread Status:
Not open for further replies.

Share This Page