Jump to content

Recommended Posts

Posted
7 minutes ago, V0idWa1k3r said:

Use the overload of GameRegistry.addSmelting(or FurnaceRecipes#addSmeltingRecipe) that takes an ItemStack as it's first parameter

could you go into more details on this please 

Posted (edited)
5 minutes ago, James_HD_UK said:

could you go into more details on this please 

I don't think I could provide more detail even if I wanted to. I gave you the method names, their location and even which overload to use.

Edited by V0idWa1k3r
Posted

The most complete furnace recipes works like this:

  • an ItemStack as an input (what will be smelted)
  • an ItemStack as output (the result of the smelting)
  • a float amount of xp

Using these 3 parameters you can pretty much smelt everything and get everything in result. So, if you want to smelt a certain variant of a block you can use something like this where you register your smelting recipes

 

ItemStack input = new ItemStack(MyBlockOrItem, 1, metadata);
ItemStack output = new ItemStack(MySmeltedBlockOrItem );
float xp = 0.0F;

GameRegistry.addSmelting(input, output, xp);

 

About the parameters 

  • MyBlockOrItem is the block/item you want to smelt. This must be changed to what your block/item is called in the source code.
  • metadata is the numeric variant that you want to smelt. For example: if you have a block/item that has 3 variants and you want to smelt the second one, then you have to type 1 assuming that variants numbers starts to 0. If you want to know what the numeric variant of your block/item is, just press F3+H in game and have a look at your block/item in inventory. You'll notice the block id followed by / and a number. That number is the metadata value
  • MySmeltedBlockOrItem is the block/item you get as result of the smelting. Now, here you can go further using this 
    ItemStack output = new ItemStack(MySmeltedBlockOrItem, quantity, metadata);

    so you can even return a specific variant of a block/item as result too in the quantity you prefer.

  • xp is the amount of experience you get when you take the smelt result from the furnace. You can get an idea of what value type in by looking at the vanilla values here https://minecraft.gamepedia.com/Smelting

 

Don't blame me if i always ask for your help. I just want to learn to be better :)

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.