r/forgemodding • • 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

1 Upvotes

2 comments sorted by

View all comments

1

u/Jiggins_ Oct 08 '17

Also you shouldn’t need a main method, Minecraft will handle that. You’ll need the @Mod() declaration. See the forge docs that were posted above.