Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I've browsed the internet for ages now, and I cannot seem to find an answer.  I have an ore I just created (genericOre) and wanted to smelt it into an ingot (genericIngot) however I have no idea how I'm meant to use the addSmelting command.  If it helps, I was following the 'generic' tutorial on the wiki to the letter, until now when I thought I would try to smelt my new ore into the corresponding ingot.  The source is on the wiki, but I can post it up here later if needed.  Any help appreciated.

From the wiki:

 

After you've put in the functions to add the ore to the library, then you just use:

GameRegistry.addSmelting(int itemID, ItemStack result, float experience);

like this:

GameRegistry.addSmelting(Block.stone.blockID, new ItemStack(Block.stoneBrick), 0.1f);

 

The first one must be a single itemID, because smelting only ever takes one item at a time. The second one is an item stack of one item, that is the result. The last value is the exp per smelting action.

the wiki tut uses a standard block already in minecraft. i found i couldn't use (Block.genericBlock.blockID... as it would give me and error. genericBlock being my custom block.

 

however i used:

 

GameRegistry.addSmelting(this.genericBlock.blockID, new ItemStack(this.genericIngot), 0.5F);

 

 

and it seemed to work just fine. I've it used it successfully 4 times so far. I would be open to feed on if this is a good method for adding smelting recipes?

Yeah, that is the way it's meant to be done. Nice catch Bishamonten.

 

Blocks.<block> is the vanilla minecraft way of storing all the blocks. When you create a new block it won't be in the vanilla list, so you have to access and use the blockID of the block you have created. This depends on where you've stored the reference to the block.

 

You can drop the keyword 'this' from the functions and it will still work.

 

Blakedut2: Also, I tried to find the code on the wiki, but I couldn't find it. Perhaps a link to it would be helpful next time, hint hint.

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.