Posted April 16, 201411 yr I want to create blocks out of the dyes but can't find what the dyes are called to but into the recipe as dyes such as "bonemeal" doesnt work?
April 16, 201411 yr They aren't called by their specific name - they have metadata. The way to get the item (for example, bonemeal) is to get it by its metadata. (Items.dye, int metadata) Bonemeal is Dye (metadata: 15) Items.dye, 15.
April 16, 201411 yr Author ok thanks but how does that work if the code is getting a string GameRegistry.addRecipe(new ItemStack(dyeblock1, 1), new Object[] {" ","BB ","BB ", 'B', Item.itemRegistry.getObject("bonemeal")}); } because it wouldnt function if i changed bonemeal to Item.Dyes, 15. Also arent they (trying to) removing that in 1.8 so would there be another way to call the dyes
April 16, 201411 yr You don't call items like that. GameRegistry.addRecipe(new ItemStack(dyeblock1, 1), new Object[] {" ","BB ","BB ", 'B', new ItemStack(Items.dye, 1, 15)}); Would be how you do it. From what I know, the Item class is what contains all the methods that you'll use and it initialises the items, but the Items class is where you call the items from when using the item objects in code. When you need metadata for something you use an ItemStack call it using "new ItemStack(Block/Item, amount, metadata)" so yours would be new ItemStack(Items.dye, 1, 15) where Items.dye is the dye item 1 is the amount (which is irrelevant really, because it sorta defaults to 1 and nothing higher really works as far as I know) and 15 would be the metadata
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.