# Table of Contents
1. [Introduction](#Intro)
2. [Server Setup](#ServerSetup)
4. [Launch Scripts](#LaunchScripts)

# <a name="Intro"></a>Introduction
## Portforwarding
Making a Minecraft server can be easy if you're making it for your family or your friends at your house, but doing it for anybody else can be a lot more complicated. Due to this, I will not be covering portforwarding, and you will not receive support for it from me.

Portforwarding depends on your router, and includes complicated firewall setup. If you're determined, or somewhat advanced, please Google how to do it. Some example searches could be:

- [How to portforward a Minecraft server?](https://www.google.com/search?q=how+to+portforward+a+Minecraft+server&oq=how+to+portforward+a+Minecraft+server)
- [How to enable portforwarding on \<type of router\>](https://www.google.com/search?q=how+to+enable+port+forwarding+on+a+netgear+r7000)

Or various other phrases with keywords including Minecraft, your router name, and "portforwarding."

## Frequently Asked Questions
- Why were the library files not included?
  - Minecraft, Minecraft Forge, and Sponge Powered do not allowed Library files to be distributed by anyone other than themselves.
- I have an issue!
  - Please contact me [on my Discord server](https://discord.gg/0xxkiR1rO4zRsYLp) and I will try my best to help you. However, please keep in mind that I do NOT provide support for Hamachi servers, and if you don't know what you're talking about I will NOT provide support to you.

# <a name="ServerSetup"></a>Server Setup
## Preparing Your Server
1. Download the ZIP file available on the [modpack's home page](https://www.technicpack.net/modpack/yogbox-20).
2. Extract the ZIP file using your operating system or a program like 7-Zip or WinRar.
3. Put the extracted folder where you would like your server to live on your computer, as this is where everything will run from.

## Installing Your Server
1. Go to [Minecraft Forge's website](https://files.minecraftforge.net/)
2. Find the 1.12 section, open it, and click on \`1.12.2\`
3. Click the "show all versions" button
4. Find the latest version, or if you have issues, version \`14.23.5.2838\`
5. Click on "installer" to download the installer
6. Run the installer
  - To run the installer, you must have Java installed on your machine.
  - If you don't want to install Java and are on Windows, you can use the "win-installer" instead, which is an executable file.
7. Select "Install Server"
8. For the file location, click on the "..." and navigate to your server directory.
  - The warning that there are already files is OK and EXPECTED.
9. Click "OK", and wait for your server to install.
10. If you want to install plugins, see below. Then, proceed to step 11.
11. Create a launch script by going to the [Launch Scripts](#LaunchScripts) section, then proceed to step 12
12. Launch the server using your launch script
13. Edit the "eula.txt" file from "eula=false" to "eula=true"
14. Launch your server
15. You have now completed the installation process!

## Installing Plugins (Optional)
1. Go to [Sponge's website](https://www.spongepowered.org/)
2. Click on "downloads" in the navigation bar or scroll down until you see downloads
3. Under "Sponge Forge", click "download"
4. Click "download" next to the latest/recommended build
5. Drag the downloaded jar file into the mods folder
  - You have now installed SpongeForge, but you haven't installed any plugins
6. To install plugins, first go into the mods folder and create a folder called "plugins"
7. Head over to [Ore](https://ore.spongepowered.org/), Sponge's plugin repository, and download any plugins you want to install
8. Put your downloaded plugins into the "plugins" folder you created, and then restart the server
9. If you choose to install or remove any plugins while your server is online, you must restart your server before any changes are applied.


# <a name="LaunchScripts"></a>Launch Scripts
A launch script is required for your server to run, but it is dependent on your operating system. Please use the process below that applies to you:

**To launch your server, you must have Java installed and located in your PATH.** If you don't know how to add it to your path, please conduct an online search on how to do it.

## Windows
1. In the main folder of your server, create a file called "launch.bat"
2. Edit the file using Notepad, Notepad++, or your text editor of choice, and insert the following code:

	\`\`\`sh
	@echo off
	title Yogbox 2.0 Server

	:launch
	echo Launching Yogbox 2.0 Server...
	java -jar FORGE_JAR_NAME.jar --nogui
	echo Restarting in 5 seconds...
	timeout 5
	goto launch
	\`\`\`

3. Replace \`FORGE_JAR_NAME\` with the name of your forge jar, for example: \`forge-1.12.2-14.23.5.2854\`
4. Save the file
5. Now, double-click on the file to launch your server :)
6. To stop the server from restarting, press CTRL+C anytime during the countdown

## Linux
1. In the main folder of your server, create a file called "launch.sh"
2. Edit the file using Notepad++ or a text editor of your choice, and insert the following code:

	\`\`\`sh
	#!/bin/bash
	while true; do
		echo "Launching Yogbox 2.0 Server...";
		java -jar FORGE_JAR_NAME.jar --nogui;
		echo "Restarting in 5 seconds...";
		sleep 5;
	done
	\`\`\`

3. Replace \`FORGE_JAR_NAME\` with the name of your forge jar, for example: \`forge-1.12.2-14.23.5.2854\`
4. Save the file
5. Open a command line/terminal in your server's directory and run \`./launch.sh\`
6. To stop the server from restarting, press CTRL+C anytime during the countdown to restart

## Mac
Unfortunately, I don't own a mac, however I believe the script is going to be extremely similar, if not the same as the Linux script.

# Congratulations!
You can now delete the instructions folder from your server, or you can keep it as a reference in case you want to change anything.