Search code examples
gradlejvm-argumentsminecraft-forge

Add jvm args from build.gradle


I've got intellij setup with ForgeGradle (Minecraft mod development) I made a thing called a coremod (it only loads when you add the loading plugin class to an jvm argument) and I'm trying to add VM options without adding them from run configuration but adding it straight from the build.gradle file. ForgeGradle uses JavaExec for runClient{} and runServer{}. I tried doing something like this

runClient {
    args = [
        "-Dfml.coreMods.load=${loadingPlugin}"
    ]
}

But it didn't do anything. Is this even possible to do?


Solution

  • args is for your program arguments, use jvmArgs instead

    runClient {
        jvmArgs "-Dfml.coreMods.load=${loadingPlugin}"
    }