MinecraftForge / ForgeGradle

Minecraft mod development framework used by Forge and FML for the gradle build system
GNU Lesser General Public License v2.1
516 stars 443 forks source link

Problem: Missing 'minecraft' dependency entry. #874

Closed hard2make1name closed 2 years ago

hard2make1name commented 2 years ago

I have a problem when i build my project The code I using in build.gralde: minecraft.runs { client { // Creates a new run configuration with the name 'client' mods { mymod { source sourceSets.main } // Adds the sourceSet 'main' as the sources for the mod 'mymod' } } } The log is below: `

Could not get unknown property 'version' for extension 'minecraft' of type net.minecraftforge.gradle.userdev.UserDevExtension.

2: Task failed with an exception.

I also tried the another: minecraft.runs.client { taskName 'runThing' // Sets the Gradle run task name. By default, this option defaults torunXwhere X is the configuration name capitalized environment 'anEnvProperty', 'someValue' // Adds an environment property to the run configuration main 'com.example.Main' // Sets the main class that will be launched by this configuration inheritArgs false // If true, or not configured, merging this configuration with another one will inherit the parent's args arg 'hello' // Adds an argument to the program jvmArg '-Xmx2G' // Adds a JVM argument singleInstance false // If this configuration should be a singleton (can only have one instance running) property 'myProperty', 'dummyValue' // Adds a system property to the configuration workingDirectory 'run' // Sets the configuration's working directory forceExit true // If true, Gradle will stop once the process finished. Defaults to true source sourceSets.api // Adds a sourceset to the classpath merge 'server', true // Merges this configuration with the 'server' one, overwriting configured properites mods.dummy { // Configures the 'dummy' mod classes sourceSets.api.output // Sets the location of the mod's classes resources files('./myResources') // Sets the location of the mod's resources source sourceSets.main // Adds a sourceset to a mod's sources } }

But the exception is still: ` 1: Task failed with an exception.

2: Task failed with an exception.

I am nearly a beginner on gradle, please help, thanks.

github-actions[bot] commented 2 years ago

:wave: We use the issue tracker exclusively for final bug reports and feature requests. However, this issue appears to be better suited for the Forge Support Forums or Forge Discord. Please create a new topic on the support forum with this issue or ask in the #tech-support channel in the Discord server, and the conversation can continue there.