Jump to content

Item Variants Possible?


nordryd

Recommended Posts

I'm no stranger to Java, but I AM somewhat new to minecraft modding. I just learned about block variants, which is perfect for the mod I'm making. It's an ice cream mod, and it's purely a playground for me to practice coding.  Variants allow me to easily add flavors.  Can you do variants with items?  I already have an enum for flavors, so can I apply that to items as well? I ask since the block variants involved the use of IBlockState, which isn't usable by Items.  Let me know if there's a way to do it. I'm sure it's pretty easy to do, but it's really late at night lol. Thanks for any pointers!

Link to comment
Share on other sites

1 hour ago, nordryd said:

Can you do variants with items?

No, but you have the metadata which you can use as variants. But it's best to have one item per variant anyway.

1 hour ago, nordryd said:

I already have an enum for flavors, so can I apply that to items as well?

You can still reuse the enum just fine, just make the item's metadata the ordinal or something.

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
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.