add a new recipe for existing item

Started by lawarmotte on

Topic category: Help with modding (Java Edition)

Last seen on 10:07, 15. Dec 2023
Joined Apr 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
add a new recipe for existing item
Sat, 04/14/2018 - 07:29 (edited)

Hi there !

Can someone tell me what's wrong with my code... I'm not able to compile it!
 

package mod.mcreator;

import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;

import net.minecraft.world.World;
import net.minecraft.util.ResourceLocation;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Item;
import net.minecraft.init.Items;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.Minecraft;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.Block;

import java.util.Random;

@SuppressWarnings("unchecked")
public class mcreator_allume {

    public mcreator_allume() {
    }

    public static Item block;
    public static Object instance;

    public void load(FMLInitializationEvent event) {
        if (event.getSide() == Side.CLIENT)
            Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
                    .register(block, 0, new ModelResourceLocation("testenvironmentmod:Allume", "inventory"));

        GameRegistry.addShapelessRecipe(new ItemStack(item.FLINT_AND_STEEL, 1),
                new Object[]{ Items.FLINT, Items.FLINT,});
    }

    public void load()
     {

          this.addRecipes();
     }
     
     public String getVersion()
     {
          return "Version 1.0";
     }
}

Thanks in advance for yours answers

Edited by lawarmotte on Sat, 04/14/2018 - 07:29
Last seen on 21:13, 31. Aug 2022
Joined May 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If you are doing it in code …
Sat, 04/14/2018 - 09:02

If you are doing it in code (like a java mod or in MCreator's code editor), I will not be useful. But if you did it in the recipe creator (in MCreator), please can you give me a screenshot of the recipe? Then I can try help you figure out what is wrong.

Also, if you edited the code by yourself (typing the code by yourself), I will be of no use because coding is not to be messed with if you are not a java coder.

In advance, if my method does not work, submit it as a bug and it should be fixed.

Last seen on 10:07, 15. Dec 2023
Joined Apr 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks for your answer. Well…
Sat, 04/14/2018 - 15:39

Thanks for your answer.

Well yes I messed up in the code myself, since I wasn't able to figure out how to create a recipe for an existing item (FLINT_AND_STEEL)

So basically I created a new dull item, and then modified the code.

 

Is there any way to do that in Mcreator ?

Last seen on 21:13, 31. Aug 2022
Joined May 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
MCreator is possible of…
Sat, 04/14/2018 - 18:04

MCreator is possible of creating existing items a new crafting recipe. As I said, I am no code expert but if you use the MCreator recipe creator then it will be possible - unless you are asking for a bigger crafting grid, there is that one limit. And if you are a coder, MCreator lets you lock/unlock the code editor for classes, so if there is something that you want to code - you can! And MCreator can create items with powers and just a regular material like iron, glowstone dust, ext.

If you are wanting help with coding, I would recommend going to the Minecraft Forum(s) and asking there - since this is a modding tool website, and not java unless a coding part of your mod. And if you need help with MCreator let a member of staff know, create another topic or you can come back here and I can help again =) Have a nice day/night. PS: I am not a staff member, but a nice helper of the community. =)

Last seen on 10:07, 15. Dec 2023
Joined Apr 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Okay, so I think I…
Sat, 04/14/2018 - 19:58

Okay, so I think I misunderstood the use of Mcreator !

I will focus on the way to use it properly, since it's seems to be a really interesting tool.

Thanks again for your patience

Last seen on 20:38, 30. Dec 2022
Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
but hey, maybe you got the…
Sun, 05/06/2018 - 23:13

but hey, maybe you got the item name wrong

but there's an option to make a crafting recipe IN MCreator

there you can select an existing item