Skip to content

Commit 2aad265

Browse files
committed
update forge docs
1 parent 43ea1dd commit 2aad265

File tree

1 file changed

+57
-88
lines changed
  • docs/mscs/adjusting-world-server-properties

1 file changed

+57
-88
lines changed

docs/mscs/adjusting-world-server-properties/forge.md

Lines changed: 57 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,18 @@ parent: Adjusting World & Server Properties
66
permalink: /docs/mscs/adjusting-world-server-properties/forge
77
---
88

9-
# Forge All Versions
9+
# Forge
10+
{: .no_toc }
11+
12+
## Table of Contents
13+
{: .no_toc .text-delta }
14+
15+
1. TOC
16+
{:toc}
17+
18+
---
19+
20+
## All Versions
1021

1122
[Forge][forge] has an easy to use installer that can be used to install all of the needed files to run a Forge server. [Download][download] the Forge installer `forge-forge-x.x.x-x.x.x-installer` and run the following as the `minecraft` user (`sudo su minecraft`) (Note: forge for Minecraft 1.16.4 is being used as an example.):
1223

@@ -19,10 +30,13 @@ java -jar forge-1.16.4-35.1.7-installer.jar --installServer
1930
The next steps are divided between _Forge 1.16.5 and before_ and _Forge 1.17.1 and later_. This is because the way that forge-1.17.1 was structered changed because ["it is no longer feasible to provide a single executable jar like was done before."][forge-1.17.1_release_notes]
2031

2132
## Forge 1.16.5 and before
22-
Please note that forge for Minecraft 1.16.4 will be used in the examples. The installer should install the forge server jar to `/opt/mscs/server/forge-1.16.4-35.1.7/forge-1.16.4-35.1.7.jar`
33+
34+
> Please note that forge for Minecraft 1.16.4 will be used in the examples.
35+
36+
The installer should install the forge server jar to `/opt/mscs/server/forge-1.16.4-35.1.7/forge-1.16.4-35.1.7.jar`
2337
and a bunch of library files in `/opt/mscs/server/forge-1.16.4-35.1.7/libraries/`.
2438

25-
Create a new server (if necessary):
39+
### Create a Server (1.16.5)
2640

2741
```bash
2842
mscs create forge 25565
@@ -33,19 +47,14 @@ mscs create forge 25565
3347
This will create the directory `forge` in `/opt/mscs/worlds` as well as the `server.properties` and `mscs.properties`
3448
files:
3549

36-
Change the directory to the world that was created:
50+
Change the directory to the world that was created and modify the `mscs.properties` file.
3751

3852
```bash
3953
cd /opt/mscs/worlds/forge
54+
editor mscs.properties
4055
```
4156

42-
Modify the `mscs.properties` file and add/alter these lines, replacing versions and file paths as needed:
43-
44-
```bash
45-
editor /opt/mscs/worlds/forge/mscs.properties
46-
```
47-
48-
Add this
57+
Add/alter these lines, replacing versions and file paths as needed:
4958

5059
```ini
5160
mscs-client-version=1.16.4
@@ -54,51 +63,13 @@ mscs-server-jar=forge-1.16.4-35.1.7/forge-1.16.4-35.1.7.jar
5463
mscs-server-url=
5564
```
5665

57-
You may also want to increase the initial RAM and possibly even the maximum RAM.
66+
Go on to [Server Control](#server-control)
5867

59-
> Minimum default is 128M
60-
> Maximum default is 2048M
68+
## Forge 1.17.1 and Later
6169

62-
```ini
63-
mscs-initial-memory=1024M
64-
mscs-maximum-memory=3048M
65-
```
66-
67-
If the server fails to start, the `eula.txt` file may need to be edited and accepted:
68-
69-
```bash
70-
editor /opt/mscs/worlds/forge/eula.txt
71-
```
70+
> Please note that forge for Minecraft 1.17.1 will be used in the examples.
7271
73-
Change `false` to `true`
74-
75-
```ini
76-
eula=true
77-
```
78-
79-
Stop then Start the server:
80-
81-
```bash
82-
mscs stop forge
83-
mscs start forge
84-
```
85-
86-
The server should start up and run
87-
88-
The server startup can be monitored by running:
89-
90-
```bash
91-
mscs watch forge
92-
```
93-
94-
Once you are done watching the server boot up, you can press `<Ctrl-C>` to detach.
95-
96-
Simply add mods as you would normally by dragging them into the `/opt/mscs/worlds/forge/mods` folder, assuming `forge`
97-
is the name of your world.
98-
99-
100-
## Forge 1.17.1 and later
101-
Please note that forge for Minecraft 1.17.1 will be used in the examples. If you named the server directory `forge-1.17.1` in the first step with the `mkdir` command, the installer should install a bash script to `/opt/mscs/server/forge-1.17.1` and a bunch of library files in `/opt/mscs/server/forge-1.17.1/libraries/`.
72+
If you named the server directory `forge-1.17.1` in the first step with the `mkdir` command, the installer should install a bash script to `/opt/mscs/server/forge-1.17.1` and a bunch of library files in `/opt/mscs/server/forge-1.17.1/libraries/`.
10273

10374
There's an automatic and a manual way to apply the fixes needed for these versions.
10475

@@ -116,18 +87,16 @@ sed -i "s|libraries|$(pwd)/libraries|g" libraries/net/minecraftforge/forge/*/uni
11687
<details>
11788
<summary>Explanation of the sed commands</summary>
11889

90+
- `sed -i "\|@[^\"]|s|@|@$(pwd)/|" run.sh`: This matches all occurences of `@` that aren't followed by `"` and adds the current directory followed by a / to it (or rather, replaces the `@` with an `@` followed by the current directory).
91+
- `sed -i "s|\"\$@|--nogui &|g" run.sh`: This adds `--nogui ` in front of `"$@`, with `&` being the matched pattern.
92+
- `sed -i "s|libraries|$(pwd)/libraries|g" run.sh`: This replaces `@libraries/net/minecraftforge/forge/1.17.1-37.1.1/unix_args.txt` with its full directory path in the `bash.sh` file.
93+
- `sed -i "s|libraries|$(pwd)/libraries|g" libraries/net/minecraftforge/forge/*/unix_args.txt`: This adds the current path to all occurences of the word libraries in the `unix_args.txt` file. Because the directory contains the forge version (for example `1.17.1-37.1.1`), `*` is used as a wildcard.
11994

120-
<span markdown='span'>`sed -i "\|@[^\"]|s|@|@$(pwd)/|" run.sh`: This matches all occurences of `@` that aren't followed by `"` and adds the current directory followed by a / to it (or rather, replaces the `@` with an `@` followed by the current directory).</span> <br>
121-
122-
<span markdown='span'>`sed -i "s|\"\$@|--nogui &|g" run.sh`: This adds `--nogui ` in front of `"$@`, with `&` being the matched pattern.</span><br>
123-
124-
<span markdown='span'>`sed -i "s|libraries|$(pwd)/libraries|g" run.sh`: This replaces `@libraries/net/minecraftforge/forge/1.17.1-37.1.1/unix_args.txt` with its full directory path in the `bash.sh` file.</span><br>
125-
126-
<span markdown='span'>`sed -i "s|libraries|$(pwd)/libraries|g" libraries/net/minecraftforge/forge/*/unix_args.txt`: This adds the current path to all occurences of the word libraries in the `unix_args.txt` file. Because the directory contains the forge version (for example `1.17.1-37.1.1`), `*` is used as a wildcard.</span>
95+
----
12796

12897
</details>
129-
<br>
130-
Continue below at <a href="#end-manual"><strong>You may also want...</strong></a>
98+
99+
Continue below at [Create a Server (1.17.1)](#create-a-server-1171)
131100

132101
### Manual
133102

@@ -144,7 +113,7 @@ The original `run.sh` script wil include `java @user_jvm_args.txt @libraries/net
144113

145114
The `@user_jvm_args.txt` and the `@libraries/net/minecraftforge/forge/1.17.1-37.1.1/unix_args.txt` need to be replaced with their full directory path. You should also include `--nogui` at the end **of the same line** before the `"$@"`. The file should now look like this:
146115

147-
```ini
116+
```bash
148117
#!/usr/bin/env sh
149118
# Forge requires a configured set of both JVM and program arguments.
150119
# Add custom JVM arguments to the user_jvm_args.txt
@@ -170,30 +139,8 @@ rm unix_args.txt
170139
cp unix_args_backup.txt unix_args.txt
171140
editor unix_args.txt
172141
```
173-
<a id="end-manual"></a>
174-
175-
You may also want to increase the initial RAM and possibly even the maximum RAM. To do this, edit the `user_jvm_args.txt` file.
176-
177-
```bash
178-
cd /opt/mscs/server/forge-1.17.1/
179-
editor user_jvm_args.txt
180-
```
181-
182-
Now add all the java arguments you wish. For example, to allocate a minimum of 4GB and a maximum of 6GB, you would make the `user_jvm_args.txt` file look something like this:
183-
184-
```ini
185-
# Xmx and Xms set the maximum and minimum RAM usage, respectively.
186-
# They can take any number, followed by an M or a G.
187-
# M means Megabyte, G means Gigabyte.
188-
# For example, to set the maximum to 3GB: -Xmx3G
189-
# To set the minimum to 2.5GB: -Xms2500M
190-
191-
# A good default for a modded server is 4GB.
192-
# Uncomment the next line to set it.
193-
-Xms4G -Xmx6G
194-
```
195142

196-
Create a new server (if necessary):
143+
### Create a Server (1.17.1)
197144

198145
```bash
199146
mscs create forge 25565
@@ -208,19 +155,41 @@ Change the directory to the world that was created and modify the `mscs.properti
208155

209156
```bash
210157
cd /opt/mscs/worlds/forge
211-
editor /opt/mscs/worlds/forge/mscs.properties
158+
editor mscs.properties
212159
```
213160

214161
Add/alter these lines, replacing versions and file paths as needed:
215162

216-
217163
```ini
218164
mscs-client-version=1.17.1
219165
mscs-server-version=1.17.1
220166
mscs-server-command=/opt/mscs/server/forge-1.17.1/run.sh
221167
mscs-server-url=
222168
```
223169

170+
You may also want to increase the initial RAM and possibly even the maximum RAM. To do this, edit the `user_jvm_args.txt` file.
171+
172+
```bash
173+
cd /opt/mscs/server/forge-1.17.1/
174+
editor user_jvm_args.txt
175+
```
176+
177+
Now add all the java arguments you wish. For example, to allocate a minimum of 4GB and a maximum of 6GB, you would make the `user_jvm_args.txt` file look something like this:
178+
179+
```ini
180+
# Xmx and Xms set the maximum and minimum RAM usage, respectively.
181+
# They can take any number, followed by an M or a G.
182+
# M means Megabyte, G means Gigabyte.
183+
# For example, to set the maximum to 3GB: -Xmx3G
184+
# To set the minimum to 2.5GB: -Xms2500M
185+
186+
# A good default for a modded server is 4GB.
187+
# Uncomment the next line to set it.
188+
-Xms4G -Xmx6G
189+
```
190+
191+
## Server Control
192+
224193
If the server fails to start, the `eula.txt` file may need to be edited and accepted:
225194

226195
```bash

0 commit comments

Comments
 (0)