Making custom recipe with customized items

Discussion in 'Spigot Plugin Development' started by Arest, Jul 14, 2015.

  1. So i tried to make a Custom Recipe with Customized Items like the recipes are :
    Snowball with the Name : "Legend Ball"
    And Stick with the name : "Legend Stick"
    So i readed ( not really gud at English ) a thread on google someone said :
    ItemStack helm = inv.getMatrix()[4]
    So can anyone explain what is matrix:
    And also can somone help me for the first step of reparing making own recipe cause i really dont know what should i do first ( I dont really know much about CraftingItemEvent and PrepareItemCraftEvent)
  2. And the matrix is getting the 4 armour slots that specific one I belive is getting the helmet in the players inventory, but remember that it can equal null
  3. I used to get Error once
  4. You used to get error? That doesn't matter, try adding custom recipe and then tell us what errors you do have
  5. Ok tks
  6. Here is the error :
    Code (Text):
    public void precipe() {
            ItemStack Fdp = new ItemStack(Material.DIAMOND_PICKAXE);
            ItemMeta fdpmeta = Fdp.getItemMeta();
            fdpmeta.setDisplayName(ChatColor.GOLD+"["+ ChatColor.AQUA + "FD" + ChatColor.GOLD + "]" + ChatColor.AQUA + "Diamond Pickaxe");
            ItemStack s = new ItemStack(Material.SNOW_BALL);
            ItemMeta sm = s.getItemMeta();
            sm.setDisplayName(ChatColor.GRAY.BOLD + "Legendary Ball");
            sm.addEnchant(Enchantment.DURABILITY, 2, true);
            ItemStack stick = new ItemStack(Material.STICK);
            ItemMeta stm = stick.getItemMeta();
            stm.setDisplayName(ChatColor.GOLD.BOLD + "Golden Stick");
            stm.addEnchant(Enchantment.DURABILITY, 2, true);
            ShapedRecipe pickrecipe = new ShapedRecipe(Fdp);
            pickrecipe.setIngredient('A', s);
            pickrecipe.setIngredient('S', stick);

    It happens when i use setIngredient at "s" and "stick" ( Legendary Ball , Golden Stick )
  7. What's the error? This is code..I can't see any errors
  8. Focus on pickrecipe.setIngredient('A',s); and pickrecipe.setIngredient('S', stick);
  9. Just use Material.SNOW_BALL and Material.STICK instead of ItemStacks
  10. No !!! I want to add custom Enchantment and Name to the recipe of SNOW BALL AND STICK !!!
  11. Make a new thread