You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[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.):
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]
20
31
21
32
## 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`
23
37
and a bunch of library files in `/opt/mscs/server/forge-1.16.4-35.1.7/libraries/`.
24
38
25
-
Create a new server (if necessary):
39
+
### Create a Server (1.16.5)
26
40
27
41
```bash
28
42
mscs create forge 25565
@@ -33,19 +47,14 @@ mscs create forge 25565
33
47
This will create the directory `forge` in `/opt/mscs/worlds` as well as the `server.properties` and `mscs.properties`
34
48
files:
35
49
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.
37
51
38
52
```bash
39
53
cd /opt/mscs/worlds/forge
54
+
editor mscs.properties
40
55
```
41
56
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:
You may also want to increase the initial RAM and possibly even the maximum RAM.
66
+
Go on to [Server Control](#server-control)
58
67
59
-
> Minimum default is 128M
60
-
> Maximum default is 2048M
68
+
## Forge 1.17.1 and Later
61
69
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.
72
71
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/`.
102
73
103
74
There's an automatic and a manual way to apply the fixes needed for these versions.
104
75
@@ -116,18 +87,16 @@ sed -i "s|libraries|$(pwd)/libraries|g" libraries/net/minecraftforge/forge/*/uni
116
87
<details>
117
88
<summary>Explanation of the sed commands</summary>
118
89
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.
119
94
120
-
<spanmarkdown='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
-
<spanmarkdown='span'>`sed -i "s|\"\$@|--nogui &|g" run.sh`: This adds `--nogui ` in front of `"$@`, with `&` being the matched pattern.</span><br>
123
-
124
-
<spanmarkdown='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
-
<spanmarkdown='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
+
----
127
96
128
97
</details>
129
-
<br>
130
-
Continue below at <ahref="#end-manual"><strong>You may also want...</strong></a>
98
+
99
+
Continue below at [Create a Server (1.17.1)](#create-a-server-1171)
131
100
132
101
### Manual
133
102
@@ -144,7 +113,7 @@ The original `run.sh` script wil include `java @user_jvm_args.txt @libraries/net
144
113
145
114
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:
146
115
147
-
```ini
116
+
```bash
148
117
#!/usr/bin/env sh
149
118
# Forge requires a configured set of both JVM and program arguments.
150
119
# Add custom JVM arguments to the user_jvm_args.txt
@@ -170,30 +139,8 @@ rm unix_args.txt
170
139
cp unix_args_backup.txt unix_args.txt
171
140
editor unix_args.txt
172
141
```
173
-
<aid="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
-
```
195
142
196
-
Create a new server (if necessary):
143
+
### Create a Server (1.17.1)
197
144
198
145
```bash
199
146
mscs create forge 25565
@@ -208,19 +155,41 @@ Change the directory to the world that was created and modify the `mscs.properti
208
155
209
156
```bash
210
157
cd /opt/mscs/worlds/forge
211
-
editor /opt/mscs/worlds/forge/mscs.properties
158
+
editor mscs.properties
212
159
```
213
160
214
161
Add/alter these lines, replacing versions and file paths as needed:
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
+
224
193
If the server fails to start, the `eula.txt` file may need to be edited and accepted:
0 commit comments