Adding permission to item recipe?

Discussion in 'Plugin Development' started by SandKastle, Jul 4, 2013.

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

    SandKastle

    So this is what im looking at right now, how would i add a permission to the recipe?

    Code:java
    1. public class CraftableHorseArmor extends JavaPlugin{
    2.  
    3. public void onEnable(){
    4. Server server = this.getServer();
    5.  
    6. ShapedRecipe iha = new ShapedRecipe(new ItemStack(417));
    7. iha.shape(" I","IBI","III");
    8. iha.setIngredient('I', Material.IRON_INGOT);
    9. iha.setIngredient('B', Material.WOOL, 15);
    10.  
    11. ShapedRecipe gha = new ShapedRecipe(new ItemStack(418));
    12. gha.shape(" I","IBI","III");
    13. gha.setIngredient('I', Material.GOLD_INGOT);
    14. gha.setIngredient('B', Material.WOOL, 14);
    15.  
    16. ShapedRecipe dha = new ShapedRecipe(new ItemStack(419));
    17. dha.shape(" I","IBI","III");
    18. dha.setIngredient('I', Material.DIAMOND);
    19. dha.setIngredient('B', Material.WOOL, 11);
    20.  
    21. ShapedRecipe saddle = new ShapedRecipe(new ItemStack(329));
    22. saddle.shape("III","IBI");
    23. saddle.setIngredient('I', Material.LEATHER);
    24. saddle.setIngredient('B', Material.IRON_INGOT);
    25.  
    26. server.addRecipe(iha);
    27. server.addRecipe(gha);
    28. server.addRecipe(dha);
    29. server.addRecipe(saddle);
    30. }
    31. }
    32.  
     
  2. Offline

    ZeusAllMighty11

    You have to check for the recipe being crafted in PrepareItemCraftEvent
     
  3. Offline

    LucasEmanuel

    Having permissions for certain recipes can be pretty tricky, I use this to do it myself :)
     
Thread Status:
Not open for further replies.

Share This Page