Jump to content

"cannot be resolved to a type"


gerbillover

Recommended Posts

I've recently set up a new workspace for Forge 1.12 and have ran into a problem.

After setting up my workspace, while writing the main mod class I found that most Forge methods like "FMLInitializationEvent" cannot be found by Eclipse. It simply states "@ Mod cannot be resolved to a type" and there are no imports available. I've made sure to add Forge as a project to the build path and while looking around, I did hear something about an src jar to add to the build path, but I couldn't find this in my Forge files.

 

I never had this issue previously when setting up with 1.7 or 1.8 versions. I'm using Forge version 14.21.1.2443 (for 1.12).

Anyone know how I can fix this?

Edited by gerbillover
Link to comment
Share on other sites

Try manually adding the import:

import net.minecraftforge.fml.common.Mod;

Does that work?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

No, that does not work. I'm assuming this means Forge isn't properly imported, I'll take a look

 

Odd, my Forge is definitely imported, it shows in the package explorer. It actually seems lots of methods are missing from my Forge install.

 

Edit: I've compared this Forge to an older 1.7.10 Forge I have which does work, and there doesn't seem to be anything missing...

Edited by gerbillover
Link to comment
Share on other sites

  • 2 years later...
On 8/30/2017 at 4:32 AM, gerbillover said:

I think I've nailed it! Completely redid my workspace, turns out I selected the wrong folders when importing the project :/ Thanks for your help though everyone :)

3 years later I face the same problem like you, How can you solve it? I've redid my workspace 2 times, but it still doesn't work. And I also tried to added 'import net.minecraftforge.fml.common.Mod;' .But after I added this into my code. 'net' went to an error too. Maybe you can tell me more useful suggestions. Thanks.😀

Link to comment
Share on other sites

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.