LatvianModder's Modding Tutorials
- Setting up workspace in IntelliJ IDEA
- gradle.properties & Dependencies
- GitHub & Multitple mods in one Project
- Proxy, Sides, Event Handlers & Basic mod files
- Items & Recipes
- Block States
- Tile Entities
- Tile Entity Special Renderers
- Commands & Server/Client only mods
- Guis and Containers
- Network & IMessages
- Loot Tables
- Access Transformers & Reflection
- Advanced IRecipes
- Other useful resources
GitHub & Multitple mods in one Project
What is Git/GitHub?
- You have probably seen it before if you have submitted an issue for a mod, because that's where they usually go.
- In simple words, git keeps track of your code changes as Commits in different Repositories (Projects).
- A single repo can also have multiple branches, which in Minecraft modding are usually used for different MC versions.
Create GitHub repository
- Go to https://github.com/, register if you haven't already, and in your Repositories page, create new.
- Make sure you set "Initialize this repository with a README" to true.
Optional step - Access Token
- I recommend to use tokens instead of email+password.
- You need to go to https://github.com/settings/tokens and generate a new one if you dont have one.
- Choose name, permissions (select everything, if you don't really care, or just "repo" and "gist" for minimum).
- Don't lose the code that gets generated, because you won't be able to see it again later.
- You can delete tokens, create multiple for different needs, etc.
- Don't share this token with anyone else, because anyone who has it, can upload to your GitHub.
- If you don't have git installed, get it from https://git-scm.com/ and follow instructions for your OS.
- You might have to add it's bin folder to path, just like with Java
Idea Project Setup
- Open Idea
- Create a new Project, select it's name and location.
- Change default module name to "MC".
- When project is created, delete the "src" folder in MC module.
- Click VCS -> Checkout from Version Control -> GitHub.
- If it asks you, Enter "github.com" as hostname, and your token or email+password.
- Select the GitHub project your want to clone, change "Parent Directory" to the location of this project, and press Clone.
- If you have a previous mod, unlinked with GitHub, you just copy all of it's files to the directory that was created/cloned.
- To add your mod to project, go to File -> Project Structure -> Modules -> Import Module -> /build.gradle.
- Unselect "Create module per source set", and click OK.
- Run "setupDecompWorkspace" Gradle task for this module and refresh it afterwards.
- Go back to Project Structure, and select MC module -> Dependencies -> + -> Select your mod module and add it, change Scope Compile to Runtime.
- Create new "Application" run config and name it "Client".
- Enter "GradleStart" as "Main class".
- Add "\MC" to "Working directory".
- You can leave "Program arguments" blank, check first tutorial for more info on them.
- Select MC in "Use classpath of module".