Skip to content

Instantly share code, notes, and snippets.

@Bricktricker
Last active January 25, 2021 12:19
Show Gist options
  • Save Bricktricker/f24b109cff73d308a5b047968fcdb457 to your computer and use it in GitHub Desktop.
Save Bricktricker/f24b109cff73d308a5b047968fcdb457 to your computer and use it in GitHub Desktop.
Serverpacklocator setup

Serverpacklocator

Guide how I install cpw's serverpacklocator on Windows for Minecraft versions 1.14.4+. This is not an offical guide and may break at any time. Use at your own risk.

Server installation

Install a basic dedicated Minecraft Forge server and whitelist all players, which want to play on the server. Then download the Mod-version from here. and place it into the mods folder in the server folder. Start the server once to generate all needed files. Go into the servermods folder and open the serverpacklcoator.toml file with a text editor. Change the name to the ip/dns name of the server. You can also change the port of the http server (Note: This is not the minecraft server port!). Delete the cacert.pem and ca.key file and start and stop the server.

Client installation

Install Forge on the client. Download the Bundle from here and drag and drop the two folders (libraries and versions) into the .minecraft folder. Currently serverpacklocator is set up for Minecraft 1.14.4, to change that, go into the .minecraft/versions folder and rename/dublicate the 1.14.4-serverpacklocator to VERSION-serverpacklocator (e.g. 1.16.1-serverpacklocator). Go into the folder and also rename the json file inside of it. Now open the json file in a text editor and locate the "id" line. Rename the following string too. Now search the "inheritsFrom" line and rename the following to MC_VERSION-forge_FORGE_VERSION (e.g. 1.16.1-forge-32.0.108). Start the Minecraft launcher and create a new installation. Give it a name and select the previously created version (e.g. release 1.16.1-serverpacklocator). Also select a new game directory, I normaly have a packs folder in the .minecraft folder, where I have sub folders for every new modpack, but you can do it how you like it. Just make sure to select a empty folder. Now create and run the new installation. Then close Minecraft again and go into the selected game directory. Go into the servermods folder and open the serverpacklocator.toml file with a text editor. Set the remoteServer setting to the ip/dns name of your Minecraft server, you may need to include the port with it (e.g. server.net:8080). Close the file and copy the serverrequest.csr file to the minecraft server pc for signing.

Certificate signing

Create a subfolder in the server folder for signing the client certificates. Put the client serverrequest.csr file into the folder and run the following command:

java -cp ..\mods\serverpacklocator-4.0.0.jar;..\forge-1.16.1-32.0.108.jar cpw.mods.forge.serverpacklocator.cert.CertSigner "..\servermods\cacert.pem" "..\servermods\ca.key" < serverrequest.csr > servercert.pem

Update the version numbers if needed: the ..\mods\serverpacklocator-4.0.0.jar part should point to your serverpacklocator mod in the mods folder. The ..\forge-1.16.1-32.0.108.jar part should point to your forge jar in the root folder of your server. After running the command you should have a servercert.pem file containing two certificates. Sometimes servercert.pem starts with a warning (WARN Advanced terminal features are not available in this environment), if so remove this line! If you need to sign multiple client certificates and you get the WARN Advanced terminal (...) warning you can use a batch file to automatically remove the warning line:

@echo off
java -cp ..\mods\serverpacklocator-4.0.0.jar;..\forge-1.16.1-32.0.108.jar cpw.mods.forge.serverpacklocator.cert.CertSigner "..\servermods\cacert.pem" "..\servermods\ca.key" < serverrequest.csr > servercert.pem.tmp
more +1 servercert.pem.tmp > servercert.pem
del servercert.pem.tmp

Make sure to update the versions as needed. Copy the generated servercert.pem file back to the client into the servermods folder.

Serverpacklocator should now be installed on the client and the server. Simply but all your mod you want to sync to the client into the servermods folder in your server folder. Launch your server and let ist start. Then you can start your client and it should download and load all mods.

Troubleshooting

Validate that your serverpacklocator.toml files have the coorect server ip/domain. On the client the name should only contain the ip/domain, e.g. example.com. On the server, the remoteServer should contain the protocol (https), the ip/domain and the port, e.g. https://example.com:8080/. Also check your certificates, you can decode them with openSSL or any online certificate decoder. The server cacert.pem file should contain one certificate, where the common name is set to the server ip/domain, e.g. example.com. The client server.pem file should contain two certificates. The first certificate should have the common name field set to your minecraft account UUID. The second certificate should have the common name field set to the server ip/domain, e.g. example.com.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment