Solved How to use custom ItemStacks in a ShapedCrafting

Discussion in 'Plugin Development' started by fireboyev, Sep 30, 2016.

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

    fireboyev

    Hey all I am wondering how I could use custom ItemStacks as an ingredient in a ShapedCrafting recipe.

    here is my code:
    Code:
            ItemStack mechSpawner = nameItem(new ItemStack(Material.MOB_SPAWNER), ChatColor.GOLD + "Mechanical Spwner", null);
            ItemStack magicSoul = nameItem(new ItemStack(Material.EYE_OF_ENDER), ChatColor.DARK_PURPLE + "Magic Soul", null);
    
            ShapedRecipe mechSpawnerRecipe = new ShapedRecipe(mechSpawner).shape("beb",
                      "eie", "beb").setIngredient('b', Material.IRON_FENCE).setIngredient('e', Material.ENDER_PEARL).setIngredient('i',magicSoul.getData());
    magicSoul.getData() is what I have been trying but it still lets me use just any eye of ender in the crafting recipe.
     
  2. Offline

    Zombie_Striker

    @fireboyev
    Ingredients only take in materials. You would have to check for data using PrepareItemCraftEvent.
     
  3. Offline

    fireboyev

    Thanks! it worked, this is now -SOLVED-
     
Thread Status:
Not open for further replies.

Share This Page