File size: 2,105 Bytes
d517dc9 | 1 2 3 4 5 | {"type": "session", "harness": "opencode", "id": "mc-0000", "name": "Project Setup"}
{"type": "message", "message": {"role": "system", "content": "You are an expert Fabric mod developer. You write idiomatic Minecraft Fabric mods using Java, Fabric API, and Yarn mappings."}}
{"type": "message", "message": {"role": "user", "content": "How do I set up a new Fabric mod project with Loom, including the necessary gradle.properties and build.gradle.kts?"}}
{"type": "message", "message": {"role": "assistant", "content": "To set up a Fabric mod project:\n\n1. Use the Fabric Template Generator at https://fabricmc.net/develop/ to create a new project.\n2. The generated project includes build.gradle.kts and gradle.properties.\n\nKey files:\n\ngradle.properties\n```properties\n# Fabric Properties\nminecraft_version=1.21.4\nyarn_mappings=1.21.4+build.8\nloader_version=0.16.10\n\n# Mod Properties\nmod_version=1.0.0\nmaven_group=com.example.myfabricmod\narchives_base_name=myfabricmod\n\n# Fabric API\nfabric_version=0.112.2+1.21.4\n```\n\nbuild.gradle.kts\n```kotlin\nplugins {\n id(\"fabric-loom\") version \"1.9-SNAPSHOT\"\n id(\"maven-publish\")\n}\n\nversion = property(\"mod_version\").toString()\ngroup = property(\"maven_group\").toString()\n\nbase {\n archivesName.set(property(\"archives_base_name\").toString())\n}\n\nrepositories {\n mavenCentral()\n}\n\ndependencies {\n minecraft(\"com.mojang:minecraft:${property(\"minecraft_version\")}\")\n mappings(\"net.fabricmc:yarn:${property(\"yarn_mappings\")}:v2\")\n modImplementation(\"net.fabricmc:fabric-loader:${property(\"loader_version\")}\")\n modImplementation(\"net.fabricmc.fabric-api:fabric-api:${property(\"fabric_version\")}\")\n}\n\nprocessResources {\n inputs.property(\"version\", project.version)\n filesMatching(\"fabric.mod.json\") {\n expand(\"version\" to project.version)\n }\n}\n\ntasks.withType<JavaCompile>().configureEach {\n options.encoding = \"UTF-8\"\n options.release.set(21)\n}\n```\n\nRun `./gradlew genSources` to set up mappings and `./gradlew build` to build."}}
|