Technic News

How to Create a Server Modpack

Creating a Server Pack ---- Under Construction ----

Other server software outside of Forge is now out of scope for this guide, they will be mentioned/linked if possible, but no instructions will be given.

Prerequisites ---- Under Construction ----

  • Already made or have a client pack([[#Creating a Client Pack]])

Picking Server Software ---- Under Construction ----

| Server | Forge Mod Support | Plugin Support | Minecraft Versions | Can Distribute | | --------------------------------------------------- | ----------------- | ---------------------------------------- | -------------------- | -------------- | | [Forge]: https://files.minecraftforge.net/ | Yes | No/yes | 1.1 - 1.13.2+ | Yes | | [Sponge]: https://www.spongepowered.org/ | Yes | [Sponge]: https://www.spongepowered.org/ | 1.10.2 - 1.13.2+ | ? | | [Thermos]: https://github.com/CyberdyneCC/Thermos | Yes | [Bukkit]: https://bukkit.org/ | 1.7.10 | Yes | | [KCauldron]: https://prok.pw/ | Yes | [Bukkit]: https://bukkit.org/ | 1.6.4, 1.7.2, 1.7.10 | ? | | [Cauldron]: http://minecraft.maeyanie.com/cauldron/ | Yes | [Bukkit]: https://bukkit.org/ | ? | ? |

In the majority of cases a pure Forge server is sufficient. If a server owner needs more than that they can take the mods and configs and instead follow the instructions for their chosen server software.

Forge Server ---- Under Construction ----

Installing Forge ---- Under Construction ----

  1. Go to https://files.minecraftforge.net in your Web browser.
  2. Select your Minecraft version
  3. Select installer from either the latest or recommended section. Recommended is considered stable while latest may be unstable due to bugs. Note that the forge version must match the client version, so if you already have a client modpack, choose the same forge as you chose for the client.
  4. Download it to your server's root folder
  5. Run the installer.
  6. Select '''Install Server'''
  7. Point it to your the server's root folder.
  8. It will now download a couple of libraries and put in the forge jar.
  9. Congratulations! You've successfully installed Forge on the server.

Removing Client Only Mods ---- Under Construction ----

In order to remove client only mods, you need to know what constitutes a client-only mod. For this you need to know that mods are comprised of 3 parts.

  1. Client Code: Code which runs only on a client(your computer). These usually are: graphical user interfaces(GUIs), minimaps, special particles/lighting, custom menus, textures, sound, etc... basically if you can see it only inside of a UI, then it is client-side. Example mods:

    • Custom Main Menu (CMM)
    • Not Enough Items (NEI)
    • Too many Items (TMI)
    • Resource Loader
    • Journey Map
    • Voxel Map
    • What Are We Looking At (WAWLA)
  2. Server Code: Code that runs only on a server. These usually are: anti-cheats, world generation, admin tools, etc... Example mods:

    • Realistic Terrain Generation(RTG)
  3. Shared Code: Code that runs both on a client and on the server. The majority of mods will have shared code. As a lot mods add: blocks, items, mobs, biomes, etc... Example mods:

    • Chisel
    • Tinker's Construct (TiCon)
    • Botania
    • Minecraft Comes Alive (MCA)
    • Baubles
    • Biome's O Plenty (BOP)

Most mods will make things easy by stating on their download page whether or not you can put them on a server. If not then you now have a general idea on what can and cannot go on a server. Additionally, note that some mods can be put solely on the client, but gain additional features when also put on the server. Example mods:

  • Just Enough Items (JEI)
  • Xaero's Minimap

Start Scripts

You will need to create one of these files.

startServer.sh (Linux & Mac OS X):

#!/bin/sh
java -Xmx2G -Xms2G -XX:MaxPermSize=128m -Dfml.core.libraries.mirror="http://mirror.technicpack.net/Technic/lib/fml/%s" -jar "<forge file name goes here>.jar" nogui

startServer.bat (windows):

java -Xmx2G -Xms2G -XX:MaxPermSize=128m -Dfml.core.libraries.mirror="http://mirror.technicpack.net/Technic/lib/fml/%%s" -jar "<forge file name goes here>.jar" nogui
pause

Parameter Breakdown ---- Under Construction ----

Let's break down what all this does.

System Parameters

| java | This is telling the system to find an environment variable called java. The environment variable points to the latest installed Java Runtime Environment(JRE) executable file. In short this is a way to start Java without having to write out the entire path which changes with each update.| | ---- | ------------------------------------------------------------ | | | |

If you have several java versions installed and your latest version isn't compatible with the Minecraft version you've selected you can either change your system default, or write out the full java path for your java install isntead of the word java in your start script.

  • For Windows if you've installed java 8 version 291 from oracle the path should be: "C:\Program Files\Java\jre1.8.0_291\bin\java.exe"code> (The quotation marks are needed since there is a space in the filepath)
  • For most Linux distros you can find the filepath with update-alternatives --list java. If not, then you're going to have to consult Google for the filepath. It can look for example like this if you've got openjdk: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java.
Java Parameters

| Xmx | This tells Java the max amount of ram(in gigabytes) it can use. More resource intensive servers will need a higher value. | | -------------- | ------------------------------------------------------------ | | Xms | This tells Java the amount of ram(in gigabytes) to allocate.
You should be setting Xmx and Xms to the same value. The reasoning behind this is that if you set a maximum of 5gb of ram(Xmx5G) and allocate 2gb of ram(Xms2G). Java will claim 2gb of ram so it cannot be used by anything else. However if it needs more than 2gb it will go ahead and claim more ram over time till it hits that 5gb maximum. However since that 3gb of ram isn't allocated at the start, other programs can claim it before Java does. Resulting in an out of memory error if there's not enough ram on the system. This is fixed by setting both Xmx and Xms to 5G | | XX:MaxPermSize | This tells Java how much ram to use for permanently storing classes and methods used by the Java Virtual Machine(JVM). On Java 8 this option will produce a warning about it being deprecated and ignored. This warning can be safely ignored. However on Java 7 this option will be beneficial. | | jar | This tells Java type of file it is running and where it is located. In this case it is the Forge server jar. |

Forge Parameters

| nogui | tells Forge to not open a graphical window and instead pipe all output to the commandline (Choosing not to enable nogui can in some situations cause extreme amounts of lag). | | ----- | ------------------------------------------------------------ | | | |

Common Issues ---- Under Construction ----

  1. Server isn't starting. This can be caused by a multitude of things, and usually, reading the last bits in the log will be able to tell you what happened. Common causes are: Failing to remove all client side mods, running the wrong java version, not having enough free ram.
  • Solutions:
  • Look for what crashed the server, if it's a mod, remove it.
  • Check the java version it's running, if it's running Minecraft 1.12.2 or below, you need java 8. Minecraft 1.13 through 1.6.5 work with java 8 through 11 (possibly more) and if you're running 1.17 you require java 16
  • If it failed to run due to having insufficient ram, allocate less or free up ram by closing other applications.
  1. Server is running Vanilla (ie, no modded things generate, attempting to place modded items makes them vanish, trying to craft them fails even though it looks like they work)
  • Solution: You've accidentally starter the minecraft_server.jar instead of the forge.jar, make sure your start script is starting the correct file.
  1. Server is lagging.
  • Solution:
  • If the lag is only apparent when exploring new areas, then this is normal. If you don't like this, you can pregenerate your world, just beware that this will take some space on your computer, and will take a while to do, so do it long before you want to play.
  • If the lag is only during normal gameplay and you've just started playing: In short, there is no easy surefire way to fix lag during normal gameplay. But in case you didn't already add nogui in the start script, do so, in particular if the server is lagging so much that not even one person can join. If your server is using up all the ram allocated and you have more free, you can allocate more. You can also try adding mods that improve performance. Another thing that can be done is look up and add java flags, but they might break things. Another option is to upgrade your hardware.
  • If the lag started after some time of playing: Consider adding a lag diagnostic mod like for example Laggoggles and running a scan to tell what exactly is causing lag, and/or then reduce number of loaded chunks, or reduce number of loaded entities, or reduce number of machines running. Also, set up periodic reboots if you haven't already and your server is running continuously for more than about 12 hours, less if you have less free ram.

Comments

You must be logged in to comment. Click here to register a new account or log in.