Minecraft-Forge Server install/launcher script
Created and supported by the All The Mods Team with special thanks to @OrdinatorStouff and @Dijkstra
GitHub: https://github.com/AllTheMods/Server-Scripts
AllTheMods Discord: https://discord.gg/FdFDVWb
Originally created for use in "All The Mods" modpacks, but is free for anyone to use, modify or distribute provided the conditions of the custom license (detailed below) are met.
These scripts will fetch the appropriate Forge installer and install it. This will also install Mojang's distribution-restricted Minecraft binary and the required libraries.
After Forge/Minecraft are installed, the same script will act as a launcher to start the server, with an auto-restart-after-crash feature as well. (No need for a separate "install" script). It's also adaptable to smoothly transition to new versions of Forge even on existing servers that have already been setup. If the installed Forge version is different from what's supplied in the settings.cfg, the script will remove the old Forge and re-download and install the version specified. The script also performs many basic checks such as looking for a valid Java version installed and checking that EULA.txt has been updated.
All relevant settings are in the easily accessible "settings.cfg" file; Modpack creators can specify their pack's Minecraft and Forge versions, and server operators can specify JVM args and RAM allocation as desired.
IF THERE ARE ANY ISSUES Please make a report on the github linked above
Windows: ServerStart.Bat (Run/Double-Click)
Linux: bash ServerStart.sh (must be bash, not shell/sh)
| Setting | Description |
|---|---|
| -i, --install, install | Runs only the install portion of the script. The server will not automatically start after. |
| -a, --auto | Skips user input stages and uses default values instead |
If you're running your server on a remote system, the following command can be used to keep it running even when you close your terminal:
nohup ./ServerStart.sh -a &>/dev/null &
Formatting is very important for it to load correctly:
SETTING=VALUE- No spaces around the equal sign
- One setting per line
*NOTE: Another debug/bypass options is for modpack creators to package and redistribute the forge installer matching their desired version as long as it's name matches the format: forge-<MinecraftVersion>-<ForgeVersion>-installer.jar If included, none will need to be downloaded first.
Java can be tweaked with launch settings that can sometimes improve the performance of Minecraft over default (no launch options), especially for 1.10+ and larger packs such as All The Mods.
BASIC
These basic settings are recommended for general use for any modpack:
-d64 -server -XX:+AggressiveOpts -XX:ParallelGCThreads=3 -XX:+UseConcMarkSweepGC -XX:+UnlockExperimentalVMOptions -XX:+UseParNewGC -XX:+ExplicitGCInvokesConcurrent -XX:MaxGCPauseMillis=10 -XX:GCPauseIntervalMillis=50 -XX:+UseFastAccessorMethods -XX:+OptimizeStringConcat -XX:NewSize=84m -XX:+UseAdaptiveGCBoundary -XX:NewRatio=3 -Dfml.readTimeout=90 -Ddeployment.trace=true -Ddeployment.log=true -Ddeployment.trace.level=all -Dfml.debugNetworkHandshake=true -Dfml.badPacketCounter=10
There are many opinions on what's considered good or not-so-good to use for JVM args that change from person-to-person, and over time. The settings above were based on this great discussion/explanation by CPW, the lead dev of EnderIO and a prominent contributor to the Forge project.
Mojang's Minecraft EULA is extremely open and forgiving, going so far as to "encourage you to do cool stuff." One of the very few explicit restrictions and "the one major rule" prohibits re-distributing Minecraft or any part of it (including the Minecraft server binary files):
"In order to ensure the integrity of the Game, we need all Game downloads and updates to come from an authorized source. It's also important for us that 3rd party tools/services don't seem "official" as we can't guarantee their quality. It's part of the responsibility we have to the customers of Minecraft."
This means that any modpack team/developer that wants to provide users with a ready-to-use server file package can't provide all the binaries and therefore would be incomplete. This script bridges that gap by dynamically fetching and installing MinecraftForge. The forge installer conveniently fetches the Minecraft binaries from Mojang's servers as well as the required library files as well providing a seamless "install" step followed by launching/running the server after initial setup.
From there we decided we wanted to go all-out providing as many features and configuration options as possible to make setting up and running a server as easy as possible. We want this to be more than just a simple "workaround" to the distribution restriction, but a full-featured option for server operators that don't use a control panel or management software.
The only reason we included a license is because we wanted it to be easier for more people to use/share this. Some places (i.e. Curse) need some form of "official" notice allowing content to be used. Since we were making a license anyway, we thought it would be nice to add an attribution clause so others didn't try to claim our work as their own. The result is this custom license based on a combination of the MIT license and a couple parts from Vaskii's Botania/Psi license:
Copyright (c) 2017 All The Mods Team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
You must give appropriate credit to the "All The Mods Team" as original
creators for any parts of this Software being used. A link back to original
content is optional but would be greatly appreciated.
It is forbidden to charge for access to the distribution of this Software or
gain money through it. This includes any type of inline advertisement, such
as url shorteners (adf.ly or otherwise) or ads. This also includes
restricting any amount of access behind a paywall. Special permission is
given to allow this Software to be bundled or distributed with projects on
Curse.com, CurseForge.com or their related sub-domains and subsidiaries.
Derivative works must be open source (have its source visible and allow for
redistribution and modification).
The above copyright notice and conditions must be included in all copies or
substantial portions of the Software, including derivative works and
re-licensing thereof.
"All The Mods Team" is not affiliated with "Mojang," "Oracle," "Curse," "Twitch," "Sponge," "Forge" or any other entity (or entity owning a referenced product) potentially mentioned in this document or relevant source code for this Software. The use of their names and/or trademarks is strictly circumstantial and assumed fair-use. All credit for their respective works, software, branding, copyrights and/or trademarks belongs entirely to them as original owners/licensers.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

