ModderDojo Java Modding 7: Adding Smelting

This is even easier than a recipe. The code can be added to init or preInit. (Note: In Forge 1.7, they recommend using putting recipes in preInit rather than init.)

You specify an input, an output and experience. The input and output are both an ItemStack with either a single item or you can specify how many items, as in recipes. Experience is a number between 0 and 1. In Java, we use a float (short floating-point number) to represent most decimal numbers, so 0.1f means a float with value 0.1.

(Thanks to Luke for this code.)


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s