So I just started using Forge. I just have a very simple example mod for learning purposes. When I export the mod using gradlew build
, everything works fine, it puts the mod into the build\libs
folder of forge. However, the name of the file is modid-1.0
. Now I am pretty sure I named the mod differently in my mcmod.info file. Why is it doing this and how can I change it? Furthermore, even though the mod runs correctly,(the minecraft launcher console prints the statement) but when I click on the mods tab in the mainmenu of minecraft my mod doesn't show up.
Also, another problem, its actually generating two files into build\libs
. One called modid-1.0 and another called modid-1.0-sources. Which one do I want to use ( meaning which one do I put into the .minecraft/mods folder)
My mcmod.info file
[
{
"modid": "myexamplemod",
"name": "Example Mod",
"description": "Example placeholder mod.",
"version": "1.0",
"mcversion": "1.8.8",
"url": "",
"updateUrl": "",
"authorList": ["ExampleDude"],
"credits": "The Forge and FML guys, for making this example",
"logoFile": "",
"screenshots": [],
"dependencies": []
}
]
Mod Source Code:
package com.example.examplemod;
import net.minecraft.init.Blocks;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
@Mod(modid = ExampleMod.MODID, version = ExampleMod.VERSION)
public class ExampleMod
{
public static final String MODID = "myexamplemod";
public static final String VERSION = "1.0";
@EventHandler
public void init(FMLInitializationEvent event)
{
// some example code
//while(true) {
for(int x = 0; x < 100; x++) {
System.out.println("My Mod Says: DIRT BLOCK >> "+Blocks.dirt.getUnlocalizedName());
}
//}
}
@EventHandler
public static void postInit(FMLPostInitializationEvent event) {
//while(true) {
System.out.println("DIRT BLOCK >> "+Blocks.dirt.getUnlocalizedName());
//}
}
}
I know for testing purposes I can run it using the console command gradlew runClient
, but I want to be able to do it the normal way for users where I can place a jar file into the mods folder of minecraft and have the mod run.
Copyright Notice:Content Author:「Ashwin Gupta」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/34375204/why-are-my-forge-mod-exports-titled-incorrectly-and-dont-show-up-in-minecraft-f