Jump to content

How to create a item, that must be smelt.. ??


mgbeenieboy

Recommended Posts

Hey, I started with modding and I am german, so sorry for bad english or bad knowledge...

 

I want to create a item (sunny side egg). You must first smelt an egg in a furnace to get it.

How can I do that?

 

PS: Do you call it "Sunny Side Egg" in USA? :D or "Fried Egg"? And do you say "Cornflakes"? :D

 

Thanks.

Link to comment
Share on other sites

You create two items (or use one item but with different metadata, but that might not be that easy if you are new to modding): one for the raw version and one for the cooked.

You create a way for a player to obtain raw egg and add smelting recipe for it.

( GameRegistry.addSmelting(ItemStack input, ItemStackoutput, float xp); )

Link to comment
Share on other sites

Where you add your recipes, add this line of code:

 

GameRegistry.addSmelting(Item.egg.shiftedIndex, new ItemStack(Item.YOURMODITEMNAME), 20);

 

Where you replace YOURMODITEMNAME with the name of the item which you used in the public static final.

The 20 is for how much exp you'll get from it, you can customize it yourself.

 

I just started coding last month, it's going great! I hope you'll get much success!

 

/Falling

Link to comment
Share on other sites

Where you add your recipes, add this line of code:

 

GameRegistry.addSmelting(Item.egg.shiftedIndex, new ItemStack(Item.YOURMODITEMNAME), 20);

 

Where you replace YOURMODITEMNAME with the name of the item which you used in the public static final.

The 20 is for how much exp you'll get from it, you can customize it yourself.

 

I just started coding last month, it's going great! I hope you'll get much success!

 

/Falling

the last number must be a float not int, also 20f exp its so much exp, like an gold ingot do just 1f why 20f for an egg?

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.

Announcements



×
×
  • Create New...

Important Information

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