Skip to content

Commit c1e4fec

Browse files
Building a Mod (FabricMC#502)
Co-authored-by: Miroma <its.miroma@proton.me>
1 parent 2bd2d95 commit c1e4fec

File tree

9 files changed

+90
-5
lines changed

9 files changed

+90
-5
lines changed

.vitepress/sidebars/develop.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ export default [
3030
text: "develop.getting_started.generating_sources",
3131
link: "/develop/getting-started/generating-sources",
3232
},
33+
{
34+
text: "develop.getting_started.building_mod",
35+
link: "/develop/getting-started/building-a-mod",
36+
},
3337
{
3438
text: "develop.getting_started.tips_and_tricks",
3539
link: "/develop/getting-started/tips-and-tricks",
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
title: Building a Mod
3+
description: Learn how to build a Minecraft mod that can be shared or tested in a production environment.
4+
authors:
5+
- cassiancc
6+
- cputnam-a11y
7+
- gdude2002
8+
- Scotsguy
9+
---
10+
11+
Once your mod is ready for testing, you're able to export it into a JAR file which can be shared on mod hosting websites, or used to test your mod in production alongside other mods.
12+
13+
## Choose Your IDE {#choose-your-ide}
14+
15+
<ChoiceComponent :choices="[
16+
{
17+
name: 'IntelliJ IDEA',
18+
href: './intellij-idea/building-a-mod',
19+
icon: 'simple-icons:intellijidea',
20+
color: '#FE2857',
21+
},
22+
{
23+
name: 'Visual Studio Code',
24+
icon: 'codicon:vscode',
25+
color: '#007ACC',
26+
},
27+
]" />
28+
29+
## Building in the Terminal {#terminal}
30+
31+
::: warning
32+
33+
Using the terminal to build a mod rather than an IDE may cause issues if your default Java installation does not match what the project is expecting. For more reliable builds, consider using an IDE that allows you to easily specify the correct version of Java.
34+
35+
:::
36+
37+
Open a terminal from the same directory as the mod project directory, and run the following command:
38+
39+
::: code-group
40+
41+
```powershell:no-line-numbers [Windows]
42+
./gradlew.bat build
43+
```
44+
45+
```sh:no-line-numbers [macOS/Linux]
46+
./gradlew build
47+
```
48+
49+
:::
50+
51+
The JARs should appear in the `build/libs` folder in your project. Use the JAR file with the shortest name outside development.
52+
53+
## Installing and Sharing {#installing-and-sharing}
54+
55+
From there, the mod can be [installed as normal](../../players/installing-mods), or uploaded to trustworthy mod hosting sites like [CurseForge](https://www.curseforge.com/minecraft) and [Modrinth](https://modrinth.com/discover/mods).
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: Building a Mod in IntelliJ IDEA
3+
description: Learn how to use IntelliJ IDEA to build a Minecraft mod that can be shared or tested in a production environment.
4+
authors:
5+
- cassiancc
6+
- cputnam-a11y
7+
- gdude2002
8+
- Scotsguy
9+
prev:
10+
text: Generating Sources in IntelliJ IDEA
11+
link: ./generating-sources
12+
next:
13+
text: Tips and Tricks for IntelliJ IDEA
14+
link: ./tips-and-tricks
15+
---
16+
17+
In IntelliJ IDEA, open the Gradle tab on the right and execute `build` under tasks. The JARs should appear in the `build/libs` folder in your project directory. Use the JAR file with the shortest name outside development.
18+
19+
![The sidebar of IntelliJ IDEA showing a highlighted build task](/assets/develop/getting-started/build-idea.png)
20+
21+
![The build/libs folder with the corrected file highlighted](/assets/develop/getting-started/build-libs.png)
22+
23+
## Installing and Sharing {#installing-and-sharing}
24+
25+
From there, the mod can be [installed as normal](../../../players/installing-mods), or uploaded to trustworthy mod hosting sites like [CurseForge](https://www.curseforge.com/minecraft) and [Modrinth](https://modrinth.com/discover/mods).

develop/getting-started/intellij-idea/generating-sources.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ prev:
77
text: Launching the Game in IntelliJ IDEA
88
link: ./launching-the-game
99
next:
10-
text: Tips and Tricks for IntelliJ IDEA
11-
link: ./tips-and-tricks
10+
text: Building a Mod in IntelliJ IDEA
11+
link: ./building-a-mod
1212
---
1313

1414
The Fabric toolchain lets you access the Minecraft source code by generating it locally, and you can use IntelliJ IDEA to conveniently navigate through it. To generate sources, you need to run the `genSources` Gradle task.

develop/getting-started/intellij-idea/tips-and-tricks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ authors:
66
- Earthcomputer
77
- JR1811
88
prev:
9-
text: Generating Sources in IntelliJ IDEA
10-
link: ./generating-sources
9+
text: Building a Mod in IntelliJ IDEA
10+
link: ./building-a-mod
1111
next: false
1212
---
1313

develop/getting-started/launching-the-game.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Launching the Game
3-
description: Learn how launch a Minecraft instance to start and debug your mods in a live game environment.
3+
description: Learn how to launch a Minecraft instance to start and debug your mods in a live game environment.
44
authors:
55
- dicedpixels
66
- IMB11
51 KB
Loading
49.1 KB
Loading

sidebar_translations.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"develop.getting_started.setting_up": "Setting Up Your IDE",
66
"develop.getting_started.opening_project": "Opening a Project",
77
"develop.getting_started.launching_game": "Launching the Game",
8+
"develop.getting_started.building_mod": "Building a Mod",
89
"develop.getting_started.generating_sources": "Generating Sources",
910
"develop.getting_started.tips_and_tricks": "IDE Tips and Tricks",
1011
"develop.items": "Items",

0 commit comments

Comments
 (0)