Jump to content

[FIXED] Missing 'minecraft' dependency


MicoMan

Recommended Posts

Hello I am new to develop mods for minecraft with forge and I was trying to set up everything after the docs and tutorials that i saw on youtube but even when i do everything right i still get errors. I've tried to search for this, but the only thread that i could found was already archived and didn't had any answer.

This is my build.gradle file:

plugins {
    id 'eclipse'
    id 'maven-publish'
    id 'net.minecraftforge.gradle' version '5.1.+'
}

version = '1.0'
group = 'io.github.micoman987.1mod' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = '1mod'

// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
java.toolchain.languageVersion = JavaLanguageVersion.of(17)

println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
minecraft {
    // The mappings can be changed at any time and must be in the following format.
    // Channel:   Version:
    // official   MCVersion             Official field/method names from Mojang mapping files
    // parchment  YYYY.MM.DD-MCVersion  Open community-sourced parameter names and javadocs layered on top of official
    //
    // You must be aware of the Mojang license when using the 'official' or 'parchment' mappings.
    // See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
    //
    // Parchment is an unofficial project maintained by ParchmentMC, separate from MinecraftForge
    // Additional setup is needed to use their mappings: https://github.com/ParchmentMC/Parchment/wiki/Getting-Started
    //
    // 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 channel: 'official', version: '1.19.2'

    // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default.

    // Default run configurations.
    // These can be tweaked, removed, or duplicated as needed.
    runs {
        client {
            workingDirectory project.file('run')

            // Recommended logging data for a userdev environment
            // The markers can be added/remove as needed separated by commas.
            // "SCAN": For mods scan.
            // "REGISTRIES": For firing of registry events.
            // "REGISTRYDUMP": For getting the contents of all registries.
            property 'forge.logging.markers', 'REGISTRIES'

            // Recommended logging level for the console
            // You can set various levels here.
            // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
            property 'forge.logging.console.level', 'debug'

            // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
            property 'forge.enabledGameTestNamespaces', archivesBaseName

            mods {
                1mod {
                    source sourceSets.main
                }
            }
        }

        server {
            workingDirectory project.file('run')

            property 'forge.logging.markers', 'REGISTRIES'

            property 'forge.logging.console.level', 'debug'

            property 'forge.enabledGameTestNamespaces', archivesBaseName

            mods {
                1mod {
                    source sourceSets.main
                }
            }
        }

        // This run config launches GameTestServer and runs all registered gametests, then exits.
        // By default, the server will crash when no gametests are provided.
        // The gametest system is also enabled by default for other run configs under the /test command.
        gameTestServer {
            workingDirectory project.file('run')

            property 'forge.logging.markers', 'REGISTRIES'

            property 'forge.logging.console.level', 'debug'

            property 'forge.enabledGameTestNamespaces', archivesBaseName

            mods {
                1mod {
                    source sourceSets.main
                }
            }
        }

        data {
            workingDirectory project.file('run')

            property 'forge.logging.markers', 'REGISTRIES'

            property 'forge.logging.console.level', 'debug'

            // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
            args '--mod', archivesBaseName, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')

            mods {
                1mod {
                    source sourceSets.main
                }
            }
        }
    }
}

// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }

repositories {
    // Put repositories for dependencies here
    // ForgeGradle automatically adds the Forge maven and Maven Central for you

    // If you have mod jar dependencies in ./libs, you can declare them as a repository like so:
    // flatDir {
    //     dir 'libs'
    // }
}

dependencies {
    // Specify the version of Minecraft to use. If this is any group other than 'net.minecraft', it is assumed
    // that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied.
    // The userdev artifact is a special name and will get all sorts of transformations applied to it.
    minecraft 'net.minecraftforge:forge:1.19.2-43.1.27'

    // Real mod deobf dependency examples - these get remapped to your current mappings
    // compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency
    // runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency
    // implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency

    // Examples using mod jars from ./libs
    // implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")

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

// Example for how to get properties into the manifest for reading at runtime.
jar {
    manifest {
        attributes([
                "Specification-Title"     : "1 mod",
                "Specification-Vendor"    : "MicoMan",
                "Specification-Version"   : "1", // We are version 1 of ourselves
                "Implementation-Title"    : project.name,
                "Implementation-Version"  : project.jar.archiveVersion,
                "Implementation-Vendor"   : "MicoMan",
                "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
        ])
    }
}

// Example configuration to allow publishing using the maven-publish plugin
// This is the preferred method to reobfuscate your jar file
jar.finalizedBy('reobfJar')
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
// publish.dependsOn('reobfJar')

publishing {
    publications {
        mavenJava(MavenPublication) {
            artifact jar
        }
    }
    repositories {
        maven {
            url "file://${project.projectDir}/mcmodsrepo"
        }
    }
}

tasks.withType(JavaCompile).configureEach {
    options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}

And this is the error that i am getting:

To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.5/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build

> Configure project :
Java: 17.0.4.1, JVM: 17.0.4.1+1 (Eclipse Adoptium), Arch: amd64

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Build file '<myPath>\1mod_1_19\build.gradle' line: 55

* What went wrong:
A problem occurred evaluating root project '1mod_1_19'.
> No signature of method: java.lang.Integer.call() is applicable for argument types: (net.minecraftforge.gradle.common.util.ModConfig) values: [net.minecraftforge.gradle.common.util.ModConfig@1a61423b]
  Possible solutions: wait(), any(), abs(), wait(long), each(groovy.lang.Closure), tap(groovy.lang.Closure)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring root project '1mod_1_19'.
> Missing 'minecraft' dependency.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

BUILD FAILED in 9s

Thanks in advance

Edited by MicoMan
Link to comment
Share on other sites

Gradle seems to be "incorrectly" interpreting something as a number.

I would guess this is related to you starting your mod id with a 1 ?

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

5 minutes ago, warjort said:

Gradle seems to be "incorrectly" interpreting something as a number.

I would guess this is related to you starting your mod id with a 1 ?

It looks like it was that. I thought that the mod Id value was a string so it didn't matter what was written there. I switched from '1mod' to 'mod1' and now it is working well. Thanks!!

Link to comment
Share on other sites

  • MicoMan changed the title to [FIXED] Missing 'minecraft' dependency

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • 논현여성정보 §BCGAME88·COMª 원주여성정보 북아현여성정보 노원여성정보 쌍림여성정보 otj83 주성여성정보 도원여성정보 김포여성정보 남양주여성정보 yor84 거제여성정보 송정여성정보 도림여성정보 상도여성정보 isf15 연남여성정보 동빙고여성정보 오금여성정보 원남여성정보 iqv35 등촌여성정보 삼성여성정보 구미여성정보 수원여성정보 kbp39 신원여성정보 길동여성정보 구산여성정보 돈의여성정보 xen96 삼전여성정보 소공여성정보 통인여성정보 봉익여성정보 ilb95 가락여성정보 의왕여성정보 동해여성정보 이태원여성정보 hub51 성북여성정보 수표여성정보 관수여성정보 행촌여성정보 qyp77 부산여성정보 동자여성정보 쌍문여성정보 봉래여성정보 wsb78 공항여성정보 거제여성정보 이촌여성정보 주자여성정보 fjg72 원효여성정보 당인여성정보 수서여성정보 광희여성정보 obg53 예지여성정보 평창여성정보 구의여성정보 효자여성정보 eyi09 삼전여성정보 통인여성정보 와룡여성정보 천연여성정보 eut82 초동여성정보 통영여성정보 송파여성정보 중동여성정보 qwo34 포천여성정보 남원여성정보 도원여성정보 현저여성정보 afk68 녹번여성정보 선릉여성정보 도렴여성정보 전농여성정보 lwg89 충정여성정보 오류여성정보 군산여성정보 오금여성정보 gdu16 이화여성정보 가산여성정보 흑석여성정보 성구여성정보 xfv83 청진여성정보 평동여성정보 익산여성정보 남원여성정보 bkw33 염곡여성정보 청진여성정보 도선여성정보 하계여성정보 mfi92 옥천여성정보 공평여성정보 연건여성정보 구의여성정보 mjv16 상수여성정보 도곡여성정보 제기여성정보 태평로여성정보 ose31
    • Direct Entry /Pre degree into,2023/(2024 Hallmark University, Ijebi Itele, Ogun  transfer form is out ☎️08O-3664OI34) OR {2348036640134)} …Supplementary Form,Pre-Degree Form (08O3664O134, Jupeb form IJMB Form, masters form,Ph.D  Form,Sandwich Form,Diploma Form,Change of institution form call (08O3664O134 OR {08O3664O134} Change of course Form,POST UTME Form
    • 신사안마 ¶BCGAME88·COM■ 월계안마 종로안마 압구정안마 응암안마 upg96 청운안마 고창안마 도렴안마 중계안마 qdb42 흑석안마 경산안마 고척안마 주성안마 abo10 광주안마 완주안마 논현안마 중화안마 gmn44 신설안마 성남안마 오산안마 구리안마 vth62 율현안마 군포안마 염곡안마 한남안마 ayg93 역촌안마 인사안마 현저안마 용강안마 uvo36 삼척안마 무교안마 망우안마 우이안마 cww95 만리안마 현석안마 진주안마 충무안마 wxm83 염곡안마 태평안마 수송안마 화방안마 cxn37 사간안마 견지안마 노고산안마 문경안마 mjq46 신문안마 가락안마 내자안마 삼전안마 lrg03 통인안마 합동안마 초동안마 봉래안마 kde08 전주안마 춘천안마 면목안마 주성안마 fby77 개포안마 도곡안마 신문안마 동해안마 aga37 예지안마 관악안마 군산안마 송정안마 jfc85 홍성안마 이천안마 천안안마 역촌안마 uod12 안국안마 배방안마 봉익안마 마포안마 ayv63 훈정안마 염창안마 전주안마 쌍림안마 lif90 장충안마 연희안마 명륜안마 태평로안마 uxm66 수하안마 예산안마 양화안마 서린안마 mve55 봉래안마 제기안마 삼선안마 노량진안마 udn70 성내안마 냉천안마 필운안마 도원안마 mye73
    • Direct Entry /Pre degree into,2023/(2024 Gregory University, Uturu transfer form is out ☎️08O-3664OI34) OR {2348036640134)} …Supplementary Form,Pre-Degree Form (08O3664O134, Jupeb form IJMB Form, masters form,Ph.D  Form,Sandwich Form,Diploma Form,Change of institution form call (08O3664O134 OR {08O3664O134} Change of course Form,POST UTME Form
    • 선릉룸카페 ◀BCGAME88·COM§ 갈월룸카페 장사룸카페 신촌룸카페 목동룸카페 osx44 용두룸카페 만리룸카페 과해룸카페 논산룸카페 acb86 개포룸카페 시흥룸카페 화동룸카페 통인룸카페 ywg03 아현룸카페 남창룸카페 이화룸카페 영암룸카페 hor79 중화룸카페 독산룸카페 사근룸카페 수서룸카페 gct11 고양룸카페 남양주룸카페 서귀포룸카페 오산룸카페 rhv14 안국룸카페 서계룸카페 장안룸카페 고흥룸카페 ulo28 상도룸카페 장안룸카페 창녕룸카페 삼선룸카페 fec04 중학룸카페 온수룸카페 거제룸카페 대흥룸카페 uhj99 원남룸카페 남가좌룸카페 내곡룸카페 상왕십리룸카페 hro60 전주룸카페 천연룸카페 성북룸카페 신천룸카페 faf42 마천룸카페 신도림룸카페 창원룸카페 도선룸카페 qew87 남학룸카페 냉천룸카페 화동룸카페 시흥룸카페 xpj06 부산룸카페 나주룸카페 봉원룸카페 고덕룸카페 net17 동두천룸카페 양천룸카페 부암룸카페 계동룸카페 cff88 고창룸카페 합정룸카페 상계룸카페 우이룸카페 fbg95 마포룸카페 상일룸카페 합정룸카페 논현룸카페 ojb22 광명룸카페 광장룸카페 안산룸카페 공주룸카페 sul23 중구룸카페 삼선룸카페 삼성룸카페 학방룸카페 xrg16 응암룸카페 인천룸카페 반포룸카페 금호룸카페 mbc32 장사룸카페 대현룸카페 다동룸카페 문래룸카페 pww83 의왕룸카페 마장룸카페 수원룸카페 여의도룸카페 vdt60 팔판룸카페 세종로룸카페 이화룸카페 삼선룸카페 twi82
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.