Solved new recipes problem

Discussion in 'Plugin Development' started by xXJustiinXx, Feb 4, 2017.

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

    xXJustiinXx

    Hello everyone,

    im having trouble with creating new craftingrecipes. Actually, I dont know why...

    Code:
      public static void helmet_Leather() {
         Helmet_Leather leather_helm = new Helmet_Leather(UUID.randomUUID(), EquipmentType.HELM , EquipmentMaterial.LEATHER,null);
         ShapedRecipe recipe = new ShapedRecipe(leather_helm.toItemStack());
         recipe.shape("MMM", "MLM", "LLL");
         recipe.setIngredient('M', Material.LEATHER);
         Bukkit.addRecipe(recipe);
       }
    This just works. If im trying to craft a leather helmet, it creates my custom one.
    But with the following recipe, its not creating a custom leather chestplate.

    Code:
      public static void chestplate_Leather()
      {
      Chestplate_Leather leather_brustplatte = new Chestplate_Leather(UUID.randomUUID(), EquipmentType.BRUSTPANZER , EquipmentMaterial.LEATHER,null);
      ShapedRecipe recipe = new ShapedRecipe(leather_brustplatte.toItemStack());
      recipe.shape("MLM", "MMM", "MMM");
      recipe.setIngredient('M', Material.LEATHER);
      Bukkit.addRecipe(recipe);
      }
    
    The funny thing is :
    If im replacing this line
    Code:
    recipe.shape("MLM", "MMM", "MMM");
    
    With this
    Code:
    recipe.shape("MLM", "MLM", "MMM");
    
    I am able to create a custom chestplate

    Can anyone help me?^^
     
  2. Offline

    Zombie_Striker

    @xXJustiinXx
    What is L ? You never specify it';s material type. If it is air, replace L with spaces.
     
  3. Offline

    xXJustiinXx

    Changed it to
    Code:
       recipe.shape("M M", "MMM", "MMM"); 
    But sadly, this isnt the fix for my problem
     
  4. Offline

    Zombie_Striker

    @xXJustiinXx
    Are you removing the base-mc crafting recipe? If not, that is your issue. You cannot have recipes with the same shape. Your current recipe is the same as the base-minecraft's recipe for armror, so base-mc overrides your recipe. You can change this by either changing the shape of your recipe or by looping through all the recipes online and removing the base minecraft one.
     
    xXJustiinXx likes this.
  5. Offline

    xXJustiinXx

    How stupid of me... Thanks, works.
     
Thread Status:
Not open for further replies.

Share This Page