Smelting more than 1 item

Started by Nanosuit2.0 on

Topic category: Help with modding (Java Edition)

Last seen on 14:33, 8. Sep 2018
Joined Aug 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Smelting more than 1 item

Hi

 

I create item (block) if is destroyed by pickaxe without silk touch, it drop 1 dust.

 

That work perfectly.

 

Than If is digged with silk touch it drop itself, work good too.

 

If you put that ore to the furnace, it  make 1 item. But I wanna incress that count how to do it (No just for that item but in general)

 

Thx

Last seen on 14:33, 8. Sep 2018
Joined Aug 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
SOLVED, HOW TO DO  IT:…
Mon, 01/15/2018 - 16:03

SOLVED, HOW TO DO  IT:

In code of your product from smelting found line

GameRegistry.addSmelting(product, new ItemStack(block), 1.0f);

Above that line write this:

ItemStack output = new ItemStack(block);
          output.setCount(smelted number);

And than replace        

new ItemStack(bloc)

in that line

GameRegistry.addSmelting(product, new ItemStack(block), 1.0f);

for your variable name in my case its output

Final code for multiple smellting look like that, you smelt 2 items by my code, replace 2 for 5 and it should give you 5

ItemStack output = new ItemStack(block);
output.setCount(2);
GameRegistry.addSmelting(item, output, 1.0f);

Last seen on 14:33, 8. Sep 2018
Joined Aug 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
In version 1.8.0 is…
Thu, 09/06/2018 - 18:05

In version 1.8.0 is situation quite different:

 

You found this part of code:

 

    public void load(FMLInitializationEvent event) {
        ItemStack smeltStack = new ItemStack(mcreator_diamondDust.block, (int) (1));
        GameRegistry.addSmelting(new ItemStack(Items.DIAMOND, (int) (1)), smeltStack, 1.0f); }

 

And all what you need to do is:

Number of outputs: 

Replace 1 on your number

 ItemStack smeltStack = new ItemStack(mcreator_diamondDust.block, (int) (1));

 

I guess that inputs work on same system:

Number of inputs:

Replace 1 on your number do not missplace with 1.0f, i mean just pure 1

 

 GameRegistry.addSmelting(new ItemStack(Items.DIAMOND, (int) (1)), smeltStack, 1.0f);