Jump to content

Recommended Posts

Posted (edited)

Making a tiny mod that basically only adds the coals and fuels from ProjectE, and would like to know how to make my Nether Star (substitution for the Philo-stone) could be used indefinitely in crafting. You'll also have to ELI5 and like I don't know ANY java. I'm very, VERY new to Java, and that is an understatement. I used MCreator for the recipe I have so far. If you could give me just a simple cut/paste of how to implement this, please do. 

Code Below.

package mod.mcreator;

import net.minecraftforge.fml.common.registry.GameRegistry;
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.crafting.Ingredient;
import net.minecraft.item.ItemStack;
import net.minecraft.init.Items;

import java.util.Random;

public class mcreator_recipepureCoal {

	public static Object instance;

	public mcreator_recipepureCoal() {
	}

	public void load(FMLInitializationEvent event) {
		ItemStack recStack = new ItemStack(mcreator_pureCoal.block, (int) (1));
		Object[] recipe = {"012", "34 ", "   ", '0', 
				Ingredient.fromStacks(new ItemStack(Items.NETHER_STAR, (int) (1))), '1',
				Ingredient.fromStacks(new ItemStack(Items.COAL, (int) (1))), '2', 
				Ingredient.fromStacks(new ItemStack(Items.COAL, (int) (1))), '3',
				Ingredient.fromStacks(new ItemStack(Items.COAL, (int) (1))), '4', 
				Ingredient.fromStacks(new ItemStack(Items.COAL, (int) (1))),};
		GameRegistry.addShapedRecipe(new ResourceLocation("testenvironmentmod:recipepurecoal"), new ResourceLocation("custom"), recStack, recipe);
	}

	public void generateNether(World world, Random random, int chunkX, int chunkZ) {
	}

	public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
	}

	public int addFuel(ItemStack fuel) {
		return 0;
	}

	public void registerRenderers() {
	}

	public void serverLoad(FMLServerStartingEvent event) {
	}

	public void preInit(FMLPreInitializationEvent event) {
	}
}

 

Edited by Syk0tic
Typos.
Posted
1 hour ago, Syk0tic said:

 I don't know ANY java. I'm very, VERY new to Java, and that is an understatement.

msb.PNG.e0c1b243a2eb1861334d56dc651e993e.PNG

Apart from that, yeah, learn java first. There are plenty of online courses/books.

 

1 hour ago, Syk0tic said:

I used MCreator

Don't. That is the worst choice anywone who wants to do minecraft modding can make. As an example as to why recipes must be made using json, not java. And even if you use java for some god forsaken reason do it in the appropriate registry event, but not in the PreInit.

Posted

I have taken the "Codecademy" Java course, and have a basic but very basic understanding. My brain refuses to commit anything other than pure hardware of computers, for some reason. So, Don't use MCreator, got it. Is there a knowledge base somewhere where I can figure out how to make my mod? Recipes, and all? And what program(s) do I use to make the mod?

Posted

For intelliJ, I got my modding environment set up using this video:

https://www.youtube.com/watch?v=RZ66HdNkank

 

The only real mistake he makes is not adding "\run" to the end of his configurations around 15:20 (he corrects it later, but not before it has some minor consequences).

 

I already had many years of experience with java and intelliJ before I started modding though, so I'm not sure if it will be as understandable for someone who isn't already familiar with java/intelliJ, but it's something.  If you're getting into programming you'll have to get used to experimenting and blowing stuff up once in a while anyway, so don't be too afraid of making a mistake.  If things don't get set up right you can always uninstall and start over.

Posted
1 hour ago, Laike_Endaril said:

For intelliJ, I got my modding environment set up using this video:

https://www.youtube.com/watch?v=RZ66HdNkank

Don't use a 20 minute video to setup your IDE. This is all you need to setup your IDE: https://mcforge.readthedocs.io/en/latest/gettingstarted/

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted
22 hours ago, larsgerrits said:

Don't use a 20 minute video to setup your IDE. This is all you need to setup your IDE: https://mcforge.readthedocs.io/en/latest/gettingstarted/

That's actually the first thing I looked at when I started.  It wasn't nearly as helpful as the video imo (in fact, if you follow steps 1-6 on that page, as is logical, and then get down to the intelliJ section, it basically says "oh, and I hope you stopped after step 3 above"; it's not well organized, should have explicit sets of steps for each IDE)

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.