Skip to content

Instantly share code, notes, and snippets.

@rlunaro
Last active June 26, 2024 20:52
Show Gist options
  • Save rlunaro/b10aef36a1607accf0f005fff4843120 to your computer and use it in GitHub Desktop.
Save rlunaro/b10aef36a1607accf0f005fff4843120 to your computer and use it in GitHub Desktop.
Creation of a Minecraft Mod Server

Steps

Things you will need

  • a computer with a running java installation
  • fair knowledge of linux and internet

Grab the necessary mod files

In my case, there is other person that recovers for me the mod files and compiles a client minecraft server for the task: it only gives me a folder with all the mod files.

Download forge installer and run it

Here: https://files.minecraftforge.net/net/minecraftforge/forge/index_1.20.1.html you can download the forge version.

In my case I will download the version 1.20.1, and the following code snippets will apply for the forge version 1.20.1:

Run it with:

java -jar forge-1.20.1-47.3.1-installer.jar 

image

The process will begin:

image

And a confirmation message will appear:

image

Our server is located in the "server" folder, and we have to upload to the server.

In our server....

You have to have a linux server to act as a minecraft server, with internet access and the capacity to expose at least some ports to the internet. The configuration of such a server is out of the scope of this gist. However, serveral solutions are out there. In my case, I am starting to use amazon EC2 to hold the servers: it's cheap if you turn off the server after use, otherwise, if you plan to have it on all day, you can host at home or on a hosting solution. In every case, network latency is a value you have to have into account.

In my case, the server must have a python installation.

Create a user for the minecraft installation

useradd --create-home --user-group --shell /bin/bash minecraft2

Upload the "server" files

tar --xz -cf server.txz server/
scp server.txz YOUR-SERVER

And uncompress them on the minecraft2 home folder of the server:

tar --xz -xf server.txz

Get the files for running the server

I have two files: backup.py and minecraft.py for running the server and make backup copies. You can get them here:

https://github.com/rlunaro/yams/tree/main/src

And config them. In the case of a forge server, you must skip the version checking and download:

image

An important thing is the configuration of the MINECRAFT_INSTALL, MINECRAFT_JAR variables. Here is an example:

image

and we are ready for the first manual start:

./minecraft.py start

Don't forget the sign of the eula.txt file

The first run will leave a eula.txt file with this content:

#By changing the setting below to TRUE you are indicating your agreement to our EULA (https://aka.ms
/MinecraftEULA).
#Wed Jun 26 20:48:53 UTC 2024
eula=false

That you obviously have to change to "yes" if you agree with the EULA and want to continue playing.

Configure server.properties file if needed

The server.properties file contains may configuration data, configure it at your convenience.

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