[Java] [Java]Let’s create a Minecraft Mod 1.16.1 [Introduction]

4 minute read

TL;DR

・We explained some modding of Minecraft 1.14.4 before. ・Next time, I will explain as much as possible about modding of Minecraft 1.16.1 again. ・First, introduce the environment construction

Introduction

I wrote some articles about modding in Minecraft before. Create [Java]Minecraft Mod 1.14.4 [Introduction] etc. These are slightly older than the main body version 1.14.4 (released in July 2019), and the additional elements in 1.16 are large scale, so considering the future trends, it is better to understand 1.14 than 1.14. I found it more useful to pioneer. Therefore, from this time, I will change the environment (while continuing the part that does not change) and write a new explanation. Also, please note that this time I’m going to make a concrete Mod image rather than just an example.

Note

I intend to add commentary and annotations as needed, but I am planning to explain it on the basis of previous commentary as a whole, so it is necessary See accordingly.

Environment

Environment

| | version | |:-:|:-:| | OS | Winsows 10 Home | | Oracle JDK | 8u212 | | Minecraft | 1.16.1 | | Minecraft Forge | 1.16.1 (32.0.108) | | InteliJ IDEA | 2020.1.3 (CE) | I’m using an older version of the JDK, but I’m still using what I introduced in the previous article. It seemed to work, so it’s the same, but maybe it should be a new JDK.

Oracle JDK (Java Development Kit)

After agreeing to the terms, download here. Again, the version is probably newer. Capture.PNG (8u212 is quite below)

If you do not have it, you need to create an Oracle profile (account). When registering, you will be asked to enter the company name and department, but if you are a student, you may use “student” as the department/position, the school name as the company name, and the school address as the address.

Run the downloaded exe to install.

InteliJ IDEA

After agreeing to the terms, download from here.Capture.PNG

Run the downloaded exe to install. Basically you don’t need to change anything.

Also, the language is English by default, so let’s make it Japanese (→Reference Article). After that, I will proceed with the story as Japanese.

Minecraft Forge MDK

After agreeing to the terms, download here. Capture.PNG

Since there is no Recommended yet, download Latest (32.0.108). If Forge’s development progresses and Recommended comes out, it is better to use it. Unzip the downloaded Zip file.

Project folder

Create a project folder in any location. This time I want to add an underwater life element, so I chose D:\projects\mc_liveinwater. Copy the following items from the Forge folder that was expanded earlier to the project folder. (You may copy the extracted folder or rename it and use it as it is. README etc. are excluded here.)

D:\projects\mc_liveinwater
├ build.gradle
├ gradle.properties
├ gradlew
├ gradlew.bat
├ gradle
│ └ wrapper
│ └ gradle-wrapper.jar
│ └ gradle-wrapper.properties
└ src
└ main
├ java
│ └ com
│ └ example
│ └ examplemod
│ └ ExampleMod.java
└ resources
├ META-INF
│ └ mods.toml
└ pack.mcmeta

Execution configuration

**Not required if you are already a reader of the above. ** Start PowerShell, change to the project directory, and execute the following command.

PS D:\projects\mc_liveinwater> .\gradlew genIntellijRuns

When BUILD SUCCESS FUL is displayed, you are done. It will take a long time, so be patient.

Import Gradle project

Start Intel iJ and click “Open” to open the project directory. You will be prompted to “Import Gradle Project” in the popup notification at the bottom right or the event log at the bottom. Click this. Some people will start automatically.

If you miss a notification Open the search for actions with ctrl+shift+"a", search for "Import Gradle Project" and select it.

Click “OK” without changing anything in the window that opens. Wait for the import to start. When finished is displayed and the import is completed, I think that Gradle items are displayed on the right side of the screen.

Start-up

Right-click on mc_liveinwater\Tasks\fg_runs\runClient from the Gradle menu -> Run to launch Minecraft for debugging. Capture.PNG (You’re warned, “Forge is still in beta!”)

** The environment construction is complete. Thank you for your hard work. **

in conclusion

From here on, we plan to write a commentary article for each topic, as in 1.14.4. I will try to write the same content as much as possible because I am aiming to be a guideline for Modding for latercomers. I will link to each article in sequence, so I hope you will read them one by one in order.

Reference

Create [Java]Minecraft Mod 1.14.4 [Introduction] Minecraft 1.14.4 Forge Mod Part 1 [Preparation of development environment IntelliJ IDEA]

Contents of each explanation

・Basic file

Explanation of additions
・Add items ・Addition of blocks ・Addition of creative tab (・Adding tools) (・Addition of armor) ・Add recipe ・Add progress ・Add tags ・Addition of features (・Adding or generating ore) .Adding and generating trees ・Addition of crops ・Addition of food ・Mod output