Gold apple and notch apple

Discussion in 'Spigot Plugin Development' started by YoungPvProck, May 17, 2015.

  1. Hello, so i'm making two new recipes, that change the craft of golden apple and notch apple.

    For normal golden apple, i set with all golden nuggets and in middle a apple, this work without problem.

    For nothc apple i'm trying to use all golden ingots and in middle apple, but the result it's the same as in normal minecraft.

    So my question, how can i change the result of the craft, i let code i'm trying.

    Code (Text):
    ItemStack apple = new ItemStack(Material.GOLDEN_APPLE);
            ShapedRecipe goldapple = new ShapedRecipe(apple);
            goldapple.setIngredient('1', Material.GOLD_NUGGET);
            goldapple.setIngredient('2', Material.GOLD_NUGGET);
            goldapple.setIngredient('3', Material.GOLD_NUGGET);
            goldapple.setIngredient('4', Material.GOLD_NUGGET);
            goldapple.setIngredient('5', Material.APPLE);
            goldapple.setIngredient('6', Material.GOLD_NUGGET);
            goldapple.setIngredient('7', Material.GOLD_NUGGET);
            goldapple.setIngredient('8', Material.GOLD_NUGGET);
            goldapple.setIngredient('9', Material.GOLD_NUGGET);

            ItemStack notchapple = new ItemStack(Material.GOLDEN_APPLE, 1, (short)1);
            ShapedRecipe notch = new ShapedRecipe(notchapple);
            notch.setIngredient('1', Material.GOLD_INGOT);
            notch.setIngredient('2', Material.GOLD_INGOT);
            notch.setIngredient('3', Material.GOLD_INGOT);
            notch.setIngredient('4', Material.GOLD_INGOT);
            notch.setIngredient('5', Material.APPLE);
            notch.setIngredient('6', Material.GOLD_INGOT);
            notch.setIngredient('7', Material.GOLD_INGOT);
            notch.setIngredient('8', Material.GOLD_INGOT);
            notch.setIngredient('9', Material.GOLD_INGOT);
  2. The problem is probably that this recipe already exists for normal golden apples.
    So instead you need to listen to PrepareItemCraftEvent and change the output from normal to magic golden apple.
  3. But if i change the result from golden apple to notch apple, then also is changed the craft with golden nuggets.. :s

    I need override default recipe, but i don't know how.
    #3 YoungPvProck, May 17, 2015
    Last edited: May 17, 2015
  4. Try using the crafting events