Using itemstacks in custom recipe

Discussion in 'Plugin Development' started by DaanSander, Apr 12, 2015.

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

    DaanSander

    Hello i am trying to make custom recipes with custom itemstacks that i have created but i can not figure out how is this possible if so how can i do it?

    this is what i have tried:
    Code:
    ItemStack tracerp = new ItemStack(Material.REDSTONE);
            ItemMeta pmeta = tracerp.getItemMeta();
    trameta.setDisplayName(ChatColor.RED + "" + ChatColor.BOLD + "Tracer bullet");
            trameta.setLore(Arrays.asList("Used in homing cannon"));
            tbullet.setItemMeta(trameta);
            ShapedRecipe trbullet = new ShapedRecipe(tbullet);
            trbullet.shape("0@0",
                    "HGH",
                    "HGH");
            trbullet.setIngredient('@', tracerp);
     
  2. @DaanSander I believe that you can only use materials. (Correct me if I'm wrong...)
     
  3. Offline

    stormneo7

    Supposedly if that was even going to work, make sure that you register the recipe.
    Code:
    Bukkit.getServer().addRecipe(recipe);
    But doesn't it give you errors in Eclipse? There's not a single constructor where you can use an ItemStack in .setIngredient()
    Code:
    setIngredient(char key, Material ingredient)
    setIngredient(char key, MaterialData ingredient)
    setIngredient(char key, Material ingredient, int raw)
     
Thread Status:
Not open for further replies.

Share This Page