tinycodinglm / mc /mc-0000.jsonl
winapiadmin's picture
Upload folder using huggingface_hub (part 16)
d517dc9 verified
|
Raw History Blame Contribute Delete
2.11 kB
opencode trace
System You are an expert Fabric mod developer. You write idiomatic Minecraft Fabric mods using Java, Fabric API, and Yarn mappings.

You are an expert Fabric mod developer. You write idiomatic Minecraft Fabric mods using Java, Fabric API, and Yarn mappings.

User

How do I set up a new Fabric mod project with Loom, including the necessary gradle.properties and build.gradle.kts?

Assistant

To set up a Fabric mod project:

  1. Use the Fabric Template Generator at https://fabricmc.net/develop/ to create a new project.
  2. The generated project includes build.gradle.kts and gradle.properties.

Key files:

gradle.properties

properties
# Fabric Properties
minecraft_version=1.21.4
yarn_mappings=1.21.4+build.8
loader_version=0.16.10

# Mod Properties
mod_version=1.0.0
maven_group=com.example.myfabricmod
archives_base_name=myfabricmod

# Fabric API
fabric_version=0.112.2+1.21.4

build.gradle.kts

kotlin
plugins {
    id("fabric-loom") version "1.9-SNAPSHOT"
    id("maven-publish")
}

version = property("mod_version").toString()
group = property("maven_group").toString()

base {
    archivesName.set(property("archives_base_name").toString())
}

repositories {
    mavenCentral()
}

dependencies {
    minecraft("com.mojang:minecraft:${property("minecraft_version")}")
    mappings("net.fabricmc:yarn:${property("yarn_mappings")}:v2")
    modImplementation("net.fabricmc:fabric-loader:${property("loader_version")}")
    modImplementation("net.fabricmc.fabric-api:fabric-api:${property("fabric_version")}")
}

processResources {
    inputs.property("version", project.version)
    filesMatching("fabric.mod.json") {
        expand("version" to project.version)
    }
}

tasks.withType<JavaCompile>().configureEach {
    options.encoding = "UTF-8"
    options.release.set(21)
}

Run ./gradlew genSources to set up mappings and ./gradlew build to build.