Solved Replace an existing craft ?

Discussion in 'Plugin Development' started by Ventuss, May 6, 2016.

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

    Ventuss

    Hello !
    I have a problem. I like replace an existing craft (wood pickaxe) by Iron Pickaxe. But it does not work only with pickaxe.
    My code:
    Code:
        public void recipe() {
            ItemStack test = new ItemStack(Material.IRON_PICKAXE, 1);
            test.addEnchantment(Enchantment.DIG_SPEED, 2);
            ItemMeta meta = test.getItemMeta();
            meta.setDisplayName("§ePioche Niveau I");
            test.setItemMeta(meta);
           
            ShapedRecipe recipe = new ShapedRecipe(test);
            recipe.shape(
                    "aaa",
                    "%o%",
                    "%o%");
            recipe.setIngredient('a', Material.WOOD);
            recipe.setIngredient('o', Material.STICK);
            Bukkit.getServer().addRecipe(recipe);
           
            }
     
  2. Offline

    timtower Administrator Administrator Moderator

    Moved to plugin development.
    @Ventuss Could you define "does not work" ?
     
  3. Offline

    Ventuss

    This craft offers only the wooden deck and not the iron pickaxe
     
  4. Offline

    timtower Administrator Administrator Moderator

    Tried removing the old pickaxe recipe?
     
  5. Offline

    Ventuss

    Yeah, I would like to do this but I see absolutely not how
     
  6. Offline

    timtower Administrator Administrator Moderator

  7. Offline

    DoggyCode™

    I believe there's a RecipeMap which you could access, and remove it. Maybe through Reflection.
     
  8. Offline

    Ventuss

    Problem solved, thank you
     
  9. Offline

    Gonmarte

    Mark this as solved.
     
Thread Status:
Not open for further replies.

Share This Page