Skip to content

Commit 60b69ff

Browse files
authored
Merge pull request #7 from Manuel-A-Aviles/patch-1
Added instructions for forge 1.17.1 and later
2 parents 23577ef + 5c1f8c1 commit 60b69ff

File tree

1 file changed

+131
-5
lines changed
  • docs/mscs/adjusting-world-server-properties

1 file changed

+131
-5
lines changed

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

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

9-
# Forge
9+
# Forge All Versions
1010

11-
[Forge][forge] has an easy to use installer that can be used to install all of the needed files to run a Forge server.
12-
To install a version compatible with Minecraft 1.16.4, [download][download] the Forge installer `forge-forge-x.x.x-x.x.x-installer`
13-
and run the following as the `minecraft` user (`sudo su minecraft`):
11+
[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.):
1412

1513
```bash
1614
mkdir -p /opt/mscs/server/forge-1.16.4-35.1.7
1715
cd /opt/mscs/server/forge-1.16.4-35.1.7
1816
wget https://files.minecraftforge.net/maven/net/minecraftforge/forge/1.16.4-35.1.7/forge-1.16.4-35.1.7-installer.jar
1917
java -jar forge-1.16.4-35.1.7-installer.jar --installServer
2018
```
19+
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]
2120

22-
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`
21+
## 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`
2323
and a bunch of library files in `/opt/mscs/server/forge-1.16.4-35.1.7/libraries/`.
2424

2525
Create a new server (if necessary):
@@ -96,5 +96,131 @@ Once you are done watching the server boot up, you can press `<Ctrl-C>` to detac
9696
Simply add mods as you would normally by dragging them into the `/opt/mscs/worlds/forge/mods` folder, assuming `forge`
9797
is the name of your world.
9898

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/`.
102+
103+
In the `/opt/mscs/server/forge-1.17.1 directory`, edit `run.sh`.
104+
105+
(GNU nano is an easy to use command-line text editor if you plan to edit the file from the terminal. Install it with `sudo apt install nano` if you are using a Debian based distro. In the following instructions, to edit a file with GNU nano, replace `editor` with `nano`.)
106+
107+
```bash
108+
cd /opt/mscs/server/forge-1.17.1
109+
editor run.sh
110+
```
111+
112+
The original `run.sh` script wil include `java @user_jvm_args.txt @libraries/net/minecraftforge/forge/1.17.1-37.1.1/unix_args.txt "$@"`
113+
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:
115+
116+
```ini
117+
#!/usr/bin/env sh
118+
# Forge requires a configured set of both JVM and program arguments.
119+
# Add custom JVM arguments to the user_jvm_args.txt
120+
# Add custom program arguments {such as nogui} to this file in the next line before the "$@" or
121+
# pass them to this script directly
122+
java @/opt/mscs/server/forge-1.17.1/user_jvm_args.txt @/opt/mscs/server/forge-1.17.1/libraries/net/minecraftforge/forge/1.17.1-37.1.1/unix_args.txt --nogui "$@"
123+
```
124+
125+
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.
126+
127+
```bash
128+
cd /opt/mscs/server/forge-1.17.1/
129+
editor user_jvm_args.txt
130+
```
131+
132+
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:
133+
134+
```ini
135+
# Xmx and Xms set the maximum and minimum RAM usage, respectively.
136+
# They can take any number, followed by an M or a G.
137+
# M means Megabyte, G means Gigabyte.
138+
# For example, to set the maximum to 3GB: -Xmx3G
139+
# To set the minimum to 2.5GB: -Xms2500M
140+
141+
# A good default for a modded server is 4GB.
142+
# Uncomment the next line to set it.
143+
-Xms4G -Xmx6G
144+
```
145+
146+
Now the `unix_args.txt` file mentioned in `run.sh` needs to be edited as well to include the full directory paths. Change the directory to the one containing the `unix_args.txt` file, create a backup in case you mess up the editing, and then edit the original.
147+
148+
```bash
149+
cd /opt/mscs/server/forge-1.17.1/libraries/net/minecraftforge/forge/1.17.1-37.1.1/
150+
cp unix_args.txt unix_args_backup.txt
151+
editor unix_args.txt
152+
```
153+
154+
Every path that includes `libraries/[...]` has to be replaced with their full directory path: `/opt/mscs/server/forge-1.17.1/libraries/[...]`. If your editor of choice is GNU nano, this can be done by pressing `<Ctrl-\>`, typing `libraries` and pressing enter, then typing the full path name. In this case it would be `/opt/mscs/server/forge-1.17.1/libraries`, then press enter, then press `<a>` to replace all.
155+
156+
If you mess this up, you can always delete the `unix_args.txt` file and make another one using the backup, and start editing again.
157+
158+
```bash
159+
rm unix_args.txt
160+
cp unix_args_backup.txt unix_args.txt
161+
editor unix_args.txt
162+
```
163+
164+
Create a new server (if necessary):
165+
166+
```bash
167+
mscs create forge 25565
168+
```
169+
170+
`forge` can be replaced with any name. Ensure that port `25565` is an unused port, or change it if nessessary.
171+
172+
This will create the directory `forge` in `/opt/mscs/worlds` as well as the `server.properties` and `mscs.properties`
173+
files:
174+
175+
Change the directory to the world that was created and modify the `mscs.properties` file.
176+
177+
```bash
178+
cd /opt/mscs/worlds/forge
179+
editor /opt/mscs/worlds/forge/mscs.properties
180+
```
181+
182+
Add/alter these lines, replacing versions and file paths as needed:
183+
184+
185+
```ini
186+
mscs-client-version=1.17.1
187+
mscs-server-version=1.17.1
188+
mscs-server-command=/opt/mscs/server/forge-1.17.1/run.sh
189+
mscs-server-url=
190+
```
191+
192+
If the server fails to start, the `eula.txt` file may need to be edited and accepted:
193+
194+
```bash
195+
editor /opt/mscs/worlds/forge/eula.txt
196+
```
197+
198+
Change `false` to `true`
199+
200+
```ini
201+
eula=true
202+
```
203+
204+
Stop then Start the server:
205+
206+
```bash
207+
mscs stop forge
208+
mscs start forge
209+
```
210+
211+
The server should start up and run
212+
213+
The server startup can be monitored by running:
214+
215+
```bash
216+
mscs watch forge
217+
```
218+
219+
Once you are done watching the server boot up, you can press `<Ctrl-C>` to detach.
220+
221+
Simply add mods as you would normally by dragging them into the `/opt/mscs/worlds/forge/mods` folder, assuming `forge`
222+
is the name of your world.
223+
99224
[forge]: http://www.minecraftforge.net
100225
[download]: http://files.minecraftforge.net
226+
[forge-1.17.1_release_notes]: https://forums.minecraftforge.net/topic/102544-forge-370-minecraft-1171/

0 commit comments

Comments
 (0)