Jump to content

Dyes


majesticmadman98

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.