Difference between revisions of "YouTube-Tutorials-17"

From McJty Modding
Jump to: navigation, search
Line 3: Line 3:
Everything you need to know about 1.17.1 modding with Forge.
Everything you need to know about 1.17.1 modding with Forge.
For the 1.18 tutorial series go [YouTube-Tutorials-18 here]
For the 1.18 tutorial series go [[YouTube-Tutorials-18|here]]
==Useful links==
==Useful links==

Revision as of 14:35, 16 December 2021


Everything you need to know about 1.17.1 modding with Forge.

For the 1.18 tutorial series go here

Useful links

In these tutorials I assume that you already know Java. Note that you need to be familiar with more advanced concepts like generics and lambdas. Here are some useful links for learning Java:

Porting from 1.16.5 to 1.17.1

Two part tutorial explaining how to port a mod from 1.16.5 to 1.17.1:

* Part 1: https://www.youtube.com/watch?v=9aJjI7UDHeI&ab_channel=JorritTyberghein
* Part 2: https://www.youtube.com/watch?v=G-eQ8e4zJ8U&ab_channel=JorritTyberghein

Steps to port a mod from 1.16 to 1.17

Thanks to gigaherz for the original version of these steps:

* step 1: Make a copy of your 1.16 mod to a new folder or (alternatively) use github to make a new branch and clone that
* step 2: Download the Forge MDK and copy over the gradle folder and gradlew scripts from there, nothing else
* step 3: Edit the build.gradle to use FG 5.1+:
       classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
* step 4: Open a cmd window or bash shell (for Linux) with java16 in the JAVA_HOME and PATH. Check with 'java -version' that you really switched
* step 5: If your 1.16.5 mod is not using official mappings then run:
       gradlew -PUPDATE_MAPPINGS=1.16.5 -PUPDATE_MAPPINGS_CHANNEL=official updatemappings
* step 6: Edit the build.gradle mappings line mappings channel: 'official', version: '1.16.5' [THIS IS IMPORTANT!!]
       mappings channel: 'official', version: '1.16.5' 
* step 7: Add the following line to your build.gradle:
       apply from: 'https://raw.githubusercontent.com/SizableShrimp/Forge-Class-Remapper/main/classremapper.gradle' 
* step 8: Run the gradle command to update class names:
       gradlew -PUPDATE_CLASSNAMES=true updateClassnames
* step 9: Change the build.gradle mappings line to mappings channel: 'official', version: '1.17.1':
       mappings channel: 'official', version: '1.17.1' 
* step 10: Change the sourceCompability = ... = '1.8'  to '16'
* step 11: Change the forge dependency to minecraft 'net.minecraftforge:forge:1.17.1-37.0.1' [USE LATEST HERE, .1 WAS LATEST AT THE TIME OF WRITING]
       minecraft 'net.minecraftforge:forge:1.17.1-37.0.13' 
* step 11: Import into intellij, changing intellij's project SDK to java16, and making use the gradle jre uses the project JDK too
* step 12: Run gradlew genIntellijRuns
* step 13+: Fix code and test

The New Tutorial Series

In this new series we start a new 1.17.1 tutorial from scratch. The previous porting tutorials focused on porting the existing old tutorial to 1.17.1. But if you are new and want to learn modding from scratch then this is the place to be

Episode One: Mod setup and first item

In this episode we show how to setup your project using IntelliJ. We start from the MDK and initialize everything so you can start modding.

We also create the very first primitive item.

Concepts learned in this tutorial:

* Events and the forge + mod buses
* Setup events
* Registration of items (and other things) and when this registration happens

Link: https://www.youtube.com/watch?v=ZQK328L8s5k&ab_channel=JorritTyberghein

Episode Two: expanding on our item

Here we fully flesh out the item we added in the previous tutorial:

* A nice model (one that can change based on a property in the item)
* Some functionality (a pickaxe with extra features)
* A nice tooltip and a translatable name
* A recipe

Concepts learned in this tutorial:

* Difference between Item (singleton) and ItemStack (an actual item in the game)
* Item properties
* Json models and recipes
* Data generation (creating jsons)
* Minecraft API
* Translatable messages
* Client setup

Link: https://www.youtube.com/watch?v=ucJBgoQyMU8&ab_channel=JorritTyberghein

Episode Three: making a power generator

In this episode we make a power generator (generating Forge Energy) that takes burnable items and converts them to energy:

* The block can generate power (Forge Energy) from burnable items (coal, sticks, ...)
* The generator has a distinct front face which will change if it is generating power
* It will emit light when it is generating power
* It has a gui

Concepts learned in this tutorial:

* Blocks and BlockStates (with properties)
* Block Entities
* Capabilities (for power and items)
* Generating Forge Energy
* Data generation for loot, blockstate models and tags
* Containers and Screens

Link: https://www.youtube.com/watch?v=upF0ZKOYjx0&ab_channel=JorritTyberghein

Graph used in this tutorial:


Episode Four: making a machine that uses power

This is a small tutorial that expands on the previous one. In this episode we make a machine that can use the Forge Energy generated by the generator from episode 3.

Concepts learned in this tutorial:

* Using Forge Energy
* Render layers
* Server -> Client communication for block entities

Link: https://www.youtube.com/watch?v=gRPmxa-vHII&ab_channel=JorritTyberghein

Episode Five: updating Forge, Parchment and Configuration

This tutorial starts by updating Forge and fixing the tool for a breaking change. We also start using Parchment to get better mappings for parameter names. Finally we conclude by explaining how to add configuration to your mod.

Parchment: Parchment explanation

Concepts learned in this tutorial:

* Updating Forge
* Parchment
* Three types of config (COMMON, SERVER, and CLIENT)
* Registration BEFORE configuration!

Link: https://www.youtube.com/watch?v=mTFhrQkaxMg&ab_channel=JorritTyberghein