Bash_Scripts/CentOS/Minecraft/README.md
2021-08-04 00:48:34 -05:00

81 lines
3.4 KiB
Markdown

# Minecraft Scripts Documentation
All script usages can be found by passing the "-h" flag unless explicitly stated otherwise, for example:
`Minecraft-Start-Server -h`
## Ports
| Type | Range |
| --- | --- |
| Game Ports | 12000-12099 |
| Query Ports | 12100-12199 |
| RCON Ports | 12200-12299 |
## Minecraft-Start-Server
Used to install or start a minecraft server. All minecraft servers are installed to ~/Minecraft/ (this directory
is created automatically)
All Minecraft servers backup their `server.propeerties` file when launched with this script to their
server directory/backups. e.g. `~/Minecraft/Server-1/backups/`
- Usage:
- To run an existing server and overwrite RCON password
- `Minecraft-Start-Server -s <server id>`
- Example:
- `Minecraft-Start-Server -s 0`
- This would start "Minecraft-Server-0" and overwrite Minecraft's RCON password with the password
provided by the script
- To run an existing server, but don't overwrite the RCON password
- `Minecraft-Start-Server -s <server id> -r`
- Example:
- `Minecraft-Start-Server -s 0`
- This would start "Minecraft-Server-0", but not overwrite the RCON password in Minecraft's config
- To install a new server
- `Minecraft-Start-Server -s <new server id> -j <path/to/minecraft/server/jar>`
- Example:
- `Minecraft-Start-Server -s 0 -j ~/minecraft_server1.17.1.jar`
- This would copy the provided server jar to Server-0 and install the server
- Flags
- `-s` | `--server`
- The server id that is provided to start/install the server
- Corresponds with the server in ~/Minecraft where the ID is the number in the directory name
- `-r` | `--rcon-ignore`
- This flag will ensure that Minecraft's rcon password is not overwritten by the script
- `-i` | `--install`
- Takes in a spigot revision or just "latest", see https://www.spigotmc.org/wiki/buildtools/ for revisions
## Minecraft-Connect-Server
Used to connect to a running Minecraft server's console to see log output or kill the server with ^C (control + c)
To disconnect from an Minecraft server without killing it type ^B D, that being hold `control` and `b` and then let go of
*both* and hit `d`.
- Usage
- `Minecraft-Connect-Server <server id>`
- Example:
- `Minecraft-Connect-Server 0`
- This would connect to the server prefixed with server number "0"
- Positional Arguments
- `<server id>`
- The server number corresponding to the server in ~/Minecraft/ where the server number is the last character in
the server name
- E.g. The server is named: "Server-0" then the server number would be "0"
## Minecraft-Stop-Server
Used to stop a running Minecraft server
This sends ^C (control c) to the Minecraft server
- Usage
- `Minecraft-Stop-Server <server id>`
- Example:
- `Minecraft-Stop-Server 0`
- This would stopthe server prefixed with server number "0"
- Positional Arguments
- `<server id>`
- The server number corresponding to the server in ~/Minecraft/ where the server number is the last character in
the server name
- E.g. The server is named: "Server-0" then the server number would be "0"