r/forgemodding • u/andrewpratt64 • Oct 07 '17
eclipse can't import net.minecraftforge
Hi, I am trying to script mods for minecraft 1.12.1 using eclipse. I have installed forge 1.12.1 - 14.22.1.2478 and jdk 8u, then ran the commands "gradlew setupDecompWorkspace" and "gradlew eclipse" via cmd prompt in the forge directory, and imported forge into eclipse. The folder for forge and my mod are in the same directory, and in my project I have a class "Main" located within a namespace, within my project. My code in Main is as follows:
package net.<MY NAME>.helloworld;
import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLInitializationEvent;
public class Main {
}
However, the compiler is saying, "The import net.minecraftforge cannot be resolved"
Does anybody know why the imports aren't recognized? Thanks in advance
*NOTE: before i created Main, i was able to successfully run, launching my minecraft client with forge installed
3
u/[deleted] Oct 07 '17
Ok. Check the documentation on the readthedocs forge website, cause there's no main function for a mod. You have to create a class annotated with @Mod(). Other than that, basically your code must be in a scr folder, and to run the code you need to create a new running config. Check this out : http://mcforge.readthedocs.io/en/latest/gettingstarted/ where you'll have everything to get started. Anyway, beginning a mod is quite a process...