Removing a Crafting Recipe

Discussion in 'Plugin Development' started by bjsnow, May 19, 2013.

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

    bjsnow

    How can I remove a crafting recipe such as turning log into wood?

    I have been trying to do this but cant figure out how.
     
  2. Offline

    Craftiii4

    I use this to remove the notch apple from a server; its placed in the onEnable

    Code:java
    1. Iterator<Recipe> recipes = getServer().recipeIterator();
    2. Recipe recipe;
    3.  
    4. while(recipes.hasNext())
    5. {
    6. recipe = recipes.next();
    7. if(recipe != null && recipe.getResult().getType() == Material.GOLDEN_APPLE && recipe.getResult().getDurability() == 1)
    8. recipes.remove();
    9. }


    Or you could list to craft events and see if the result is wood, if it is cancel.
     
  3. Offline

    bjsnow

    Thank You!
     
Thread Status:
Not open for further replies.

Share This Page