Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

The attribute modid is undefined for annotation type Mod


Recommended Posts

I am learning to make Minecraft mods by following a YouTube tutorial. As per it's instructions, I downloaded latest minecraft forge(1.15.1), extracted it, then opening the powershell in the extracted directory, ran the command ".\gradlew eclipse". After that I opened eclipse and imported the forge folder as a project. I created a package inside src/main/java. Inside the package, I made a Main class file. This is the code inside the Main class file:

package com.gameatro.FirstMod;
import com.gameatro.FirstMod.util.Reference;
import net.minecraftforge.fml.common.Mod;

@Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION)
public class Main {

This, I did as per the tutorial, but in the @Mod part, I am getting the error I specified in the title at modid, name, as well as version. Also, further in the tutorial, @Instance was used inside the Main class, which was imported from "net.minecraftforge.fm1.common.Mod.Interface". But when I do it, I get error saying such module does not exist. I searched the internet but did not find such errors. I even saw the example mods for 1.15, they had the same syntax for @Mod. What should I do to fix this? I tried re decompiling the forge, downloading it again and running the command, but the error persists. What am I doing wrong?,

Link to comment
Share on other sites

1 hour ago, diesieben07 said:

No. All video tutorials I've seen so far are terrible.

To be fair, McJty's tutorials are pretty good, although they're for 1.14.4.  But, 1.15 rendering changes aside, they should work pretty well for 1.15.

Link to comment
Share on other sites

9 minutes ago, Gameatro said:

This tutorial doesn't show how to add the mods to minecraft though. I made some changes in the mod, put it in a zip file and added it to the mod folder of minecraft,but it doesn't showup in the game

That is not the correct way to build your mod.

Run gradlew build to build your mod. Refer to the documentation for more details.

Some tips:


Modder Support:


1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.



Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.



The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:


1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.



Link to comment
Share on other sites

4 hours ago, DavidM said:

That is not the correct way to build your mod.

Run gradlew build to build your mod. Refer to the documentation for more details.

ok, thanks. the tutorial doesn't tell that. it just tells to run the game and that the mod will appear the game


Link to comment
Share on other sites

5 hours ago, Gameatro said:

it just tells to run the game and that the mod will appear the game

Yeah, in the development environment. You click run in Eclipse or IntelliJ and it does. Cadiboo's tutorial doesn't explain how to export because that's covered here:


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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.


  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.