Jump to content

How to smelt ores that have meta? 1.12.2


UM3 F0R TH3 W1N

Recommended Posts

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 :)

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.