Permissions for Crafting Recipes?

Discussion in 'Plugin Development' started by Awesomeman2, Oct 2, 2013.

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

    Awesomeman2

    In one of my plugins i have crafting recipes and i wanted to know if there was anyway to do permissions for them.

    Code:
    if (config.getBoolean("mooshroom-Recipe")) {
    ShapelessRecipe mcow = new ShapelessRecipe(new ItemStack(Material.MONSTER_EGG, 1, EntityType.MUSHROOM_COW.getTypeId()));
    mcow.addIngredient(8, Material.MUSHROOM_SOUP);
    mcow.addIngredient(1, Material.EGG);
    this.getServer().addRecipe(mcow);
    }
    And when i find out how to do it where would i register the permission? (Would it be the same as commands?)
     
  2. Offline

    BungeeTheCookie

    I don't know if there is any specific way from preventing a player from crafting a certain recipe. There is a way to prevent a player from getting an item, or the recipes used to craft the item, if that's what your asking
     
  3. Offline

    Awesomeman2

  4. Offline

    xTrollxDudex

    Awesomeman2
    Listen for PrepareItemCraftEvent, check if the recipe is the one with permissions and check permission
     
  5. Offline

    Awesomeman2

    xTrollxDudex I think i did it right but its not working can you give an example?
     
  6. Offline

    Awesomeman2

  7. Offline

    Awesomeman2

    Please help someone!
     
  8. Why not simply providing the code you tried? Most people around here are more willing to help, if they don't need to provide code, but only to help others to fix their code.
     
    Mathias Eklund likes this.
  9. Offline

    Mathias Eklund

    What hapm said, if you wanted us to type the code for you, go write a plugin request or ask a developer :)
     
Thread Status:
Not open for further replies.

Share This Page