#First Time Fabric User | net.minecraft classes don't exist?

38 messages · Page 1 of 1 (latest)

digital nexus
ripe fox
#

show your build.gradle

digital nexus
#

Are there components I should cut down that irrelevant?

#

Ill get rid of whats unimportant actuallly. 1 second.

ripe fox
#

no just post the full thing

digital nexus
#

oh

ripe fox
#

!!paste

dull egretBOT
#
Using a Paste Site

When sharing a large piece of code or a log, you should use a paste site instead of uploading a file or dumping it in a large codeblock.
Dumping your code/log in a code block or a message can make it difficult for other people to read previous messages.

Paste sites and their size limits:

» GitHub Gist: 100 MiB / Requires an account
» Paste.gg: 15 MiB / Account is optional
» Mclo.gs: 10 MiB / Anonymous (designed specifically for Minecraft logs)
» Paste.ee: 1 MiB / Account is optional (raises limit to 6 MiB)
» Pastebin.com: 512 KiB / Account is optional
» Hastebin.com: 400 KiB / Anonymous

ripe fox
#

if it's too big

digital nexus
#

Am I right to post it here? its not too long to fit

ripe fox
#

yes

digital nexus
#
plugins {
    id 'fabric-loom' version '1.6-SNAPSHOT'
    id 'maven-publish'
}

version = project.mod_version
group = project.maven_group

base {
    archivesName = project.archives_base_name
}

repositories {
}

dependencies {
}

processResources {
    inputs.property "version", project.version
    inputs.property "minecraft_version", project.minecraft_version
    inputs.property "loader_version", project.loader_version
    filteringCharset "UTF-8"

    filesMatching("fabric.mod.json") {
        expand "version": project.version,
                "minecraft_version": project.minecraft_version,
                "loader_version": project.loader_version
    }
}

def targetJavaVersion = 21
tasks.withType(JavaCompile).configureEach {
    it.options.encoding = "UTF-8"
    if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
        it.options.release.set(targetJavaVersion)
    }
}

java {
    def javaVersion = JavaVersion.toVersion(targetJavaVersion)
    if (JavaVersion.current() < javaVersion) {
        toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
    }
    withSourcesJar()
}

jar {
    from("LICENSE") {
        rename { "${it}_${project.archivesBaseName}"}
    }
}

publishing {
    publications {
        create("mavenJava", MavenPublication) {
            artifactId = project.archives_base_name
            from components.java
        }
    }


    repositories {
    }
}
ripe fox
#

where are the contents of the dependencies block?

digital nexus
#

Yeah so, mainly my experience with MC development is Spigot, I've always used the intellij Plugin called "Minecraft Development", and I trust it to generate proper build.gradles.

When it generated the gradle it said:

    // Add repositories to retrieve artifacts from in here.
    // You should only use this when depending on other mods because
    // Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
    // See https://docs.gradle.org/current/userguide/declaring_repositories.html
    // for more information about repositories.
}
#

so I just assumed that loom is already sourcing the MC repo

ripe fox
#

don't use that

digital nexus
#

Appreciate it. Uno Momento

digital nexus
ripe fox
#

loom sources it from the build.gradle

#

you need to have the declared dependencies as they're the bare minimum needed

#

(excluding fabric-api, which is optional and can be removed. but you likely want it)

digital nexus
#

👍

ripe fox
#

also there's no "mc repo". loom decompiles and maps the minecraft jar

digital nexus
#

When writing a strictly client-side mod, should I still have this option selected?

ripe fox
#

you can turn it off but make sure to set the environment to client in fabric.mod.json

#

otherwise it will load on servers and crash

digital nexus
ripe fox
#

if it's set to client, yes. it will be ignored on servers

digital nexus
#

Thank yuou.

digital nexus
ripe fox
#

is this a mixin you wrote?

digital nexus
#

Yes.

#

its in the mixins.json too

ripe fox
#

then the target is wrong

#

but if the game doesn't crash, you likely need to update idea

digital nexus
#

Yeah, it's only idea thats getting it wrong. it doesn't crash