Mod加载不成功


版本信息
你使用的IDE:IntelliJ IDEA
你使用的IDE版本: 2019.3.3
Forge版本: 1.12.2-14.23.5.2847
Minecraft版本: 1.12.2

错误情况简述
根据教程修改的mcmod.info启动游戏 mod并未加载 显示未找到mod信息,请提供文件,
但是这个文件真实存在在项目资源文件夹中
文件结构

主类

package com.example.examplemod;

import net.minecraftforge.fml.common.Mod;

@Mod(modid = ExampleMod.MODID, name = ExampleMod.NAME, version = ExampleMod.VERSION)
public class ExampleMod
{
    public static final String MODID = "examplemod";
    public static final String NAME = "Example Mod";
    public static final String VERSION = "1.0";
}

gradle.build

buildscript {
    repositories {
        jcenter()
        maven { url = "https://files.minecraftforge.net/maven" }
    }
    dependencies {
        classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
    }
}
apply plugin: 'net.minecraftforge.gradle.forge'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.


version = "1.0"
group = "com.example.examplemod" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "examplemod"

sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
compileJava {
    sourceCompatibility = targetCompatibility = '1.8'
}

minecraft {
    version = "1.12.2-14.23.5.2847"
    runDir = "run"
    
    // the mappings can be changed at any time, and must be in the following format.
    // snapshot_YYYYMMDD   snapshot are built nightly.
    // stable_#            stables are built at the discretion of the MCP team.
    // Use non-default mappings at your own risk. they may not always work.
    // simply re-run your setup task after changing the mappings to update your workspace.
    mappings = "snapshot_20171003"
    // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
}

dependencies {
    // you may put jars on which you depend on in ./libs
    // or you may define them like so..
    //compile "some.group:artifact:version:classifier"
    //compile "some.group:artifact:version"
      
    // real examples
    //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev'  // adds buildcraft to the dev env
    //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env

    // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
    //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'

    // the deobf configurations:  'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided,
    // except that these dependencies get remapped to your current MCP mappings
    //deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
    //deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev'

    // for more info...
    // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
    // http://www.gradle.org/docs/current/userguide/dependency_management.html

}

processResources {
    // this will ensure that this task is redone when the versions change.
    inputs.property "version", project.version
    inputs.property "mcversion", project.minecraft.version

    // replace stuff in mcmod.info, nothing else
    from(sourceSets.main.resources.srcDirs) {
        include 'mcmod.info'
                
        // replace version and mcversion
        expand 'version':project.version, 'mcversion':project.minecraft.version
    }
        
    // copy everything else except the mcmod.info
    from(sourceSets.main.resources.srcDirs) {
        exclude 'mcmod.info'
    }
}


mcmod.info

[
  {
    "modid": "examplemod",
    "name": "Example Mod",
    "description": "this is a Example mod.",
    "version": "1.0",
    "mcversion": "1.12.2",
    "url": "",
    "updateUrl": "",
    "authorList": ["jihuayu"],
    "credits": "The Forge and FML guys, for making this example",
    "logoFile": "",
    "screenshots": [],
    "dependencies": []
  }
]

FledgeXu


试试,先build mod 然后加载build后的mod。



build 的 mod可以加载成功



请问可以修复吗 build mod调试模组会很麻烦


FledgeXu


你的mcmod.info也改不了几次……有什么麻烦的。
要改的话修改Run configuration里的内容。



请问修改哪项


FledgeXu


Before launch: Build、Activate、Tool Windows
应该是在这里,具体怎么改我没改过,请自己尝试。
而且我觉得没有必要改,改了还会影响日常开发时游戏启动的速度,得不偿失。



请问能改build jar的路径吗


FledgeXu


自行更改build.gradle


system


该主题在最后一个回复创建后7天后自动关闭。不再允许新的回复。