# Minecraft Server Skynet can host many game servers, however one of the most popular (going back through teh years) is Minecraft. ## Base Templates The base templates for the servers are called [eggs][eggs]. These are basically scripts to setup and run the servers in question. These are created by laying other eggs on top of each otehr to create a single config. Bit of a PITA to make. ### mcsleepingserverstarter-Packwiz-Purpur-Geyser-Floodgate This is the core Minecraft egg and can be found [here][eggs_main]. It comprises of several components bodged together #### Sleeping Server Starter This is a core component of being able to host multiple servers for multiple Clubs/Socs as it allows us to reduce the footprint of the server when nto so many folks are using it. It listens on Java and Bedrock ports as a low power process and when someone tries to connect it spins up the full server. Coupled with a plugin which shuts down teh server after the last person leaves it is pretty good for keeping resourse useage low. #### Packwiz Packwiz is a package/plugin/mod manager for minecraft which is compatible with source control. The main repo for the plugins can be found [here][config_repo], with branches for each server configured with it It allows us to have several plugins as a base that can be used by all servers. ##### Geyser and Floodgate These pair together to allow bedrock players to connect and play with a Java server. Quite useful as this encompasses console players. ##### ViaVersion This and its partner plugins allow people who dont have the exact right version to match the server to connect. Not perfect but it works pretty well. #### Purpur Purpur is a minecraft server which supports plugins. It is a descendant of Paper and Bukkit and can use plugins built for those. ## Server - New ### Create user account On the [admin page][panel_users] create an account for the Club/Soc which is getting the server. Use their UL Wolves email for the email, username can be whatever as long as its descriptive of the Club/Soc. Their role should be ``Server Admin``. For password use a random string (I use 42 characters) and then email it to their Wolves address. We are able to reset it in the future if required. ### Server setup #### Config 1. On the [config repo][config_repo] fork off of main and name it after the Club/Soc and push. 2. Then on the web version of teh repo find that branch and teh ``pack.toml`` and click into it. 3. In the top right hand corner of the file you will see a button called ``raw``, select that. ![Raw File Button](minecraft/raw_file.png) 4. Copy the link of the page, will be used shortly. #### Pelican Setup On Pelican, on the [servers page][panel_servers] create a new server. ##### Information ###### Name Enter teh Club/Soc who is getting it. ###### Owner Select teh account you created earlier. ###### Primary Allocation You will need to select the ``+``. For ``IP Address`` select teh ``193.1.99.xyz`` address. For ``Ports`` enter the minecraft port you have chosen, you can see the existing ports on [NixOS][nixos_minecraft] Java ports take the form of ``255XY`` while Bedrock takes ``244XY``, with teh ``XY`` being teh same for both (makes it easier to keep track). Once ye have that chosen click on teh ``Next Step``. ##### Egg Configuration ###### Egg Select the ``mcsleepingserverstarter-Packwiz-Purpur-Geyser-Floodgate`` egg. ###### Packwiz URL Then enter teh URL you copied previously into the input. Once ye have that chosen click on teh ``Next Step``. ##### Environment Configuration ###### Memory Set this to be ``Limited`` and between ``8000`` and ``12000`` Once ye have that chosen click on teh ``Create Server``. #### NixOS In NixOS you have to create DNS entries so folks can easily connect to teh server. Location is in [``minecraft.nix``][nixos_minecraft], copy the existing format. This will allow players to connect to ``minecraft.$CLUBSOC.games.skynet.ie``, although bedrock players will still need to use the port. ### Server Configuration #### ``server.properties`` This is to allow bedrock users to text chat ```` enforce-secure-profile: false ```` #### ``plugins/Geyser-Spigot/config.yml`` Set the bedrock port ```yaml bedrock: port: 24423 ``` Also set the authtype to be ``floodgate`` ```yaml remote: auth-type: floodgate ``` #### ``sleepingSettings.yml`` Bedrock port needs to be added to this file: ```yaml bedrockPort: 24423 ``` ## Server - Update ### Plugins Modification #### DevShell In the [config repo][config_repo] run this command to enter teh devshell which gives you access to ``packwiz``: ```shell nix develop ``` #### Add Once in the devshell use the add command to add a plugin. ```shell packwiz modrinth add $LinkToModrinthPlugin ``` Commit and push. #### Update To update all plugins you can use this command ```shell packwiz update --all ``` Commit and push. #### Remove To remove a plugin just delete the ``*.pw.toml``. Then run the refresh command to update teh pack ```shell packwiz refresh ``` Commit and push. ### Server Update Now that teh pack has been updated you need to restart teh server to pull it in. 1. ``Stop`` the server * This stops the java server, does not start teh ``sleepingserverstarter`` server. 2. ``Kill`` the server * This stops the ``sleepingserverstarter`` server. 3. ``Start`` the server * This restarts everything and pulls in teh updates. [eggs]: https://panel.games.skynet.ie/admin/eggs [eggs_main]: https://panel.games.skynet.ie/admin/eggs/22/edit?tab=-configuration-tab [config_repo]: https://forgejo.skynet.ie/silver/Testing_packwiz [panel_users]: https://panel.games.skynet.ie/admin/users [panel_servers]: https://panel.games.skynet.ie/admin/servers [nixos_minecraft]: https://forgejo.skynet.ie/Skynet/nixos/src/branch/main/applications/games/minecraft.nix#L27