我们本次来进行Minecraft 1.20.x 模组开发环境配置教程的介绍。
效果演示 效果演示 效果演示
1.首先我们需要下载Java17和1.20模组开发包:
Java17下载官网
1.20.xForge MDK下载官网
找到Mdk的按钮点击并下载即可。
2.下载后解压该开发包,并用Idea打开:
之后等待系统自动构建环境:
出现Build Successful则说明项目成功构建了。
打开文件 -> 项目结构 -> 修改SDK版本为Java17 -> 应用
文章来源:https://www.toymoban.com/news/detail-595404.html
打开文件 -> 设置 -> 构建,执行,部署 -> 修改Gradle JVM
文章来源地址https://www.toymoban.com/news/detail-595404.html
3.打开build.gradle文件,修改group字段和archivesBaseName字段:
buildscript {
repositories {
maven {
url = 'https://maven.minecraftforge.net' }
mavenCentral()
maven {
url = 'https://maven.parchmentmc.org' }
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
classpath 'org.parchmentmc:librarian:1.+'
classpath 'org.spongepowered:mixingradle:0.7.+'
}
}
plugins {
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
}
version = '0.1'
//修改你的包名路径
group = 'com.joy187.re8joymod'
base {
//填写你的modid
archivesName = 're8joymod'
}
// 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 {
if (project.hasProperty('forge_ats_enabled') && project.findProperty('forge_ats_enabled').toBoolean()) {
// This location is hardcoded in Forge and can not be changed.
// https://github.com/MinecraftForge/MinecraftForge/blob/be1698bb1554f9c8fa2f58e32b9ab70bc4385e60/fmlloader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/ModFile.java#L123
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
project.logger.debug('Forge Access Transformers are enabled for this project.')
}
// 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 u
到了这里,关于Minecraft 1.20.x Forge模组开发 01.Idea开发环境配置的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!