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

The attribute modid is undefined for annotation type Mod


Gameatro
 Share

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:

Spoiler

Modder Support:

Spoiler

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.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

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

6.

Quote

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:

Spoiler

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:

https://mcforge.readthedocs.io/en/1.14.x/gettingstarted/#building-and-testing-your-mod

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.

Guest
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.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • I tried to make an entity, but when I summon my entity, Minecraft crashes: https://gist.github.com/ArianKG/27288da1b8d670817711372a9e715d96 Source code: https://github.com/ArianKG/KGForge
    • en un servidor que he intentado crear me da este error es de la 1.12.2       ---- Minecraft Crash Report ---- WARNING: coremods are present:   Do not report to Forge! (If you haven't disabled the FoamFix coremod, try disabling it in the config! Note that this bit of text will still appear.) (foamfix-0.10.7-1.12.2.jar)   llibrary (llibrary-core-1.0.11-1.12.2.jar)   iceandfire (iceandfire-1.8.3.jar)   AppleCore (AppleCore-mc1.12.2-3.2.0.jar)   CreativePatchingLoader (CreativeCore_v1.9.68_mc1.12.2.jar)   MalisisCorePlugin (malisiscore-1.12.2-6.5.1.jar)   McLib core mod (mclib-1.0.3-1.12.2.jar)   LoadingPlugin (Bloodmoon-MC1.12.2-1.5.3.jar) Contact their authors BEFORE contacting forge // Uh... Did I do that? Time: 20/10/21 14:03 Description: Exception in server tick loop net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Decocraft (props) Caused by: java.lang.OutOfMemoryError: Java heap space     at java.awt.image.DataBufferByte.<init>(Unknown Source)     at java.awt.image.ComponentSampleModel.createDataBuffer(Unknown Source)     at java.awt.image.Raster.createWritableRaster(Unknown Source)     at javax.imageio.ImageTypeSpecifier.createBufferedImage(Unknown Source)     at javax.imageio.ImageReader.getDestination(Unknown Source)     at com.sun.imageio.plugins.png.PNGImageReader.readImage(Unknown Source)     at com.sun.imageio.plugins.png.PNGImageReader.read(Unknown Source)     at com.mia.craftstudio.utils.ImageIOCS.read(ImageIOCS.java:26)     at com.mia.craftstudio.CSModel.<init>(CSModel.java:379)     at com.mia.craftstudio.CSPack.readPackFile(CSPack.java:197)     at com.mia.craftstudio.CSProject.loadPacks(CSProject.java:252)     at com.mia.craftstudio.minecraft.forge.CSLibMod.getCSProjectAndLoad(CSLibMod.java:91)     at com.mia.props.Props.loadModels(Props.java:209)     at com.mia.props.Props.preInit(Props.java:166)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)     at java.lang.reflect.Method.invoke(Unknown Source)     at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:637)     at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)     at java.lang.reflect.Method.invoke(Unknown Source)     at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)     at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)     at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)     at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)     at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)     at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)     at com.google.common.eventbus.EventBus.post(EventBus.java:217)     at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219)     at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details:     Minecraft Version: 1.12.2     Operating System: Windows 10 (x86) version 10.0     Java Version: 1.8.0_251, Oracle Corporation     Java VM Version: Java HotSpot(TM) Client VM (mixed mode, sharing), Oracle Corporation     Memory: 3977648 bytes (3 MB) / 259522560 bytes (247 MB) up to 259522560 bytes (247 MB)     JVM Flags: 0 total;      IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0     FML: MCP 9.42 Powered by Forge 14.23.5.2855 43 mods loaded, 42 mods active     States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored     | State | ID                  | Version               | Source                                  | Signature                                |     |:----- |:------------------- |:--------------------- |:--------------------------------------- |:---------------------------------------- |     | LCH   | minecraft           | 1.12.2                | minecraft.jar                           | None                                     |     | LCH   | mcp                 | 9.42                  | minecraft.jar                           | None                                     |     | LCH   | FML                 | 8.0.99.99             | forge-1.12.2-14.23.5.2855.jar           | e3c3d50c7c986df74c645c0ac54639741c90a557 |     | LCH   | forge               | 14.23.5.2855          | forge-1.12.2-14.23.5.2855.jar           | e3c3d50c7c986df74c645c0ac54639741c90a557 |     | LCH   | creativecoredummy   | 1.0.0                 | minecraft.jar                           | None                                     |     | LCH   | foamfixcore         | 7.7.4                 | minecraft.jar                           | None                                     |     | LCH   | securitycraft       | v1.8.12.1             | [1.12.2]+SecurityCraft+v1.8.12.1.jar    | None                                     |     | LCH   | damageindicatorsmod | 1.0                   | [1.12.2]DamageIndicatorsMod-3.5.1.jar   | None                                     |     | LCH   | applecore           | 3.2.0                 | AppleCore-mc1.12.2-3.2.0.jar            | None                                     |     | LCH   | jei                 | 4.15.0.268            | jei_1.12.2-4.15.0.268.jar               | None                                     |     | LCH   | appleskin           | 1.0.9                 | AppleSkin-mc1.12-1.0.9.jar              | None                                     |     | LCH   | astralsorcery       | 1.6.1                 | astralsorcery-1.12-1.6.1.jar            | None                                     |     | LCH   | baubles             | 1.5.2                 | Baubles-1.12-1.5.2.jar                  | None                                     |     | LCH   | bloodmoon           | 1.5.3                 | Bloodmoon-MC1.12.2-1.5.3.jar            | d72e0dd57935b3e9476212aea0c0df352dd76291 |     | LCH   | chesttransporter    | 2.8.8                 | Chest-Transporter-Mod-1.12.2.jar        | None                                     |     | LCH   | playerrevive        | 1.0                   | PlayerRevive_v1.2.28_mc1.12.2.jar       | None                                     |     | LCH   | creativecore        | 1.9.9                 | CreativeCore_v1.9.68_mc1.12.2.jar       | None                                     |     | LCE   | props               | 2.6.3                 | Decocraft-2.6.3_1.12.2.jar              | None                                     |     | LC    | dynamictrees        | 1.12.2-0.9.5          | DynamicTrees-1.12.2-0.9.5.jar           | None                                     |     | LC    | harvestcraft        | 1.12.2zb              | Pam's+HarvestCraft+1.12.2zf.jar         | None                                     |     | LC    | dynamictreesphc     | 1.12.2-1.4.2          | DynamicTreesPHC-1.12.2-1.4.2.jar        | None                                     |     | LC    | mclib               | 1.0.3                 | mclib-1.0.3-1.12.2.jar                  | None                                     |     | LC    | emoticons           | 0.3                   | emoticons-0.3-1.12.2-dist.jar           | None                                     |     | LC    | fencejumper         | 1.0.5                 | fencejumper-1.12-1.0.5.jar              | None                                     |     | LC    | ferdinandsflowers   | 1.10.4.1              | Ferdinand's+Flowers-1.12.x-1.10.4.1.jar | None                                     |     | LC    | foamfix             | 0.10.7-1.12.2         | foamfix-0.10.7-1.12.2.jar               | None                                     |     | LC    | waila               | 1.8.26                | Hwyla-1.8.26-B41_1.12.2.jar             | None                                     |     | LC    | llibrary            | 1.7.19                | llibrary-1.7.19-1.12.2.jar              | b9f30a813bee3b9dd5652c460310cfcd54f6b7ec |     | LC    | iceandfire          | 1.8.3                 | iceandfire-1.8.3.jar                    | None                                     |     | LC    | ichunutil           | 7.2.2                 | iChunUtil-1.12.2-7.2.2.jar              | 4db5c2bd1b556f252a5b8b54b256d381b2a0a6b8 |     | LC    | infernalmobs        | 1.7.6                 | InfernalMobs-1.12.2.jar                 | None                                     |     | LC    | journeymap          | 1.12.2-5.5.4          | journeymap-1.12.2-5.5.4.jar             | None                                     |     | LC    | laggoggles          | FAT-1.12.2-4.8        | LagGoggles-FAT-1.12.2-4.8.jar           | None                                     |     | LC    | libraryex           | 1.0.12                | LibraryEx-1.12.2-1.0.12.jar             | None                                     |     | LC    | magma_monsters      | 0.3.0                 | MagmaMonsters-0.3.0.jar                 | None                                     |     | LC    | malisiscore         | 1.12.2-6.5.1-SNAPSHOT | malisiscore-1.12.2-6.5.1.jar            | None                                     |     | LC    | malisisdoors        | 1.12.2-7.3.0          | malisisdoors-1.12.2-7.3.0.jar           | None                                     |     | LC    | netherex            | 2.0.15                | NetherEx-1.12.2-2.0.15.jar              | None                                     |     | LC    | playerskins         | 1.0.4                 | playerskin-1.12.2-1.0.5.jar             | None                                     |     | LC    | radixcore           | 1.12.x-2.2.1          | RadixCore-1.12.x-2.2.1-universal.jar    | None                                     |     | LC    | cactusmod           | 1.2.1                 | The-Cactus-Mod-1.12.2.jar               | None                                     |     | LC    | tombstone           | 3.5.9                 | tombstone-3.5.9-1.12.2.jar              | None                                     |     | UD    | mclib_core          | 1.0.3                 | minecraft.jar                           | None                                     |     Loaded coremods (and transformers):  Do not report to Forge! (If you haven't disabled the FoamFix coremod, try disabling it in the config! Note that this bit of text will still appear.) (foamfix-0.10.7-1.12.2.jar)   pl.asie.foamfix.coremod.FoamFixTransformer llibrary (llibrary-core-1.0.11-1.12.2.jar)   net.ilexiconn.llibrary.server.core.plugin.LLibraryTransformer   net.ilexiconn.llibrary.server.core.patcher.LLibraryRuntimePatcher iceandfire (iceandfire-1.8.3.jar)   com.github.alexthe666.iceandfire.patcher.IceAndFireRuntimePatcher AppleCore (AppleCore-mc1.12.2-3.2.0.jar)   squeek.applecore.asm.TransformerModuleHandler CreativePatchingLoader (CreativeCore_v1.9.68_mc1.12.2.jar)    MalisisCorePlugin (malisiscore-1.12.2-6.5.1.jar)    McLib core mod (mclib-1.0.3-1.12.2.jar)   mchorse.mclib.core.McLibCMClassTransformer LoadingPlugin (Bloodmoon-MC1.12.2-1.5.3.jar)   lumien.bloodmoon.asm.ClassTransformer     Profiler Position: N/A (disabled)     Is Modded: Definitely; Server brand changed to 'fml,forge'     Type: Dedicated Server (map_server.txt)
    • https://gist.github.com/twixsbar/62ebb07f0c4877c7c62023fda1b8961f tell me if this works
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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