I'm having a problem creating recipe's using Dye or the item that creates the dye such as Dandelion or in some cases DyeYellow. Code: goldDISK.setIngredient('A', Material.DANDELION); -> Dandelion or Rose does not work. goldDISK.setIngredient('A', DyeColor.YELLOW); -> Error with setIngredient. What i'm trying to achieve is make recipe's for the disc, but i can't seem to figure this line out. I tried other blocks like rose and bonemeal but noticed they would not work either? Assuming i'm missing alot? Thanks
What exactly doesn't work? Does it give an error message? Also, post a little bit more of your code so we can see how you actually set up the shaped recipe.
Code: ShapedRecipe blackDISC = new ShapedRecipe(new ItemStack(2263, 1)); blackDISC.shape(new String[]{"CBC", "BAB", "CBC"}); blackDISC.setIngredient('A', Material.INK_SACK); blackDISC.setIngredient('B', Material.OBSIDIAN); getServer().addRecipe(blackDISC); What i'm trying to do is replace the INK_SACK with a dye colour, so i can make different Discs. For instance it won't allow me to compile if i put in dye ID's or the item ID name.
Thanks. Keep in mind that you don't need the new String[] since the method uses varargs (aka String...). Even so, that wouldn't affect the outcome of your code. Are you getting any errors? What exactly doesn't work?
i edited my post, but i want to change INK_SAC and use either the DYE ID numbers or Dye Name. It just won't allow me to compile. if i change the material line for dyecolor.Yellow it then give me a random error for setingredient.
Oh, I get it now, it's not working because all the dyes are the same item. So you need to specify the data as an additional argument, like this: Code:java blackDISC.setIngredient('A', Material.INK_SAC, DyeColor.YELLOW.getData()); Repeat with the other colors for the other discs. Simple as that.
DyeColor.getData() returns the data for wool blocks, i.e. the inverse of the dye colors (don't ask me why...). You'll have to invert it yourself: Code:java blackDISC.setIngredient('A', Material.INK_SAC, 15 - DyeColor.YELLOW.getData());