0% found this document useful (0 votes)
31 views2 pages

New Text Document

This script checks if the Minecraft and Forge JAR files are present. If not, it downloads and installs them. It also checks for and downloads the Minecraft server JAR file if needed. The script checks for and creates an eula.txt file if one is not present, requiring the user to agree to Mojang's EULA. If all requirements are met, the server is started.

Uploaded by

yessssssss
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views2 pages

New Text Document

This script checks if the Minecraft and Forge JAR files are present. If not, it downloads and installs them. It also checks for and downloads the Minecraft server JAR file if needed. The script checks for and creates an eula.txt file if one is not present, requiring the user to agree to Mojang's EULA. If all requirements are met, the server is started.

Uploaded by

yessssssss
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

:: Start script generated by ServerPackCreator.

:: This script checks for the Minecraft and Forge JAR-files, and if they are not
found, they are downloaded and installed.
:: If everything is in order, the server is started.
@ECHO off
SetLocal EnableDelayedExpansion

SET JAVA="java"
SET MINECRAFT="1.16.5"
SET FORGE="36.2.29"
SET ARGS=
SET OTHERARGS="-Dlog4j2.formatMsgNoLookups=true"

SET AGREE="I agree"

IF NOT EXIST forge.jar (

ECHO Forge Server JAR-file not found. Downloading installer...


powershell -Command "(New-Object
Net.WebClient).DownloadFile('https://files.minecraftforge.net/maven/net/
minecraftforge/forge/%MINECRAFT%-%FORGE%/forge-%MINECRAFT%-%FORGE%-installer.jar',
'forge-installer.jar')"

IF EXIST forge-installer.jar (

ECHO Installer downloaded. Installing...


java -jar forge-installer.jar --installServer
MOVE forge-%MINECRAFT%-%FORGE%.jar forge.jar

IF EXIST forge.jar (
DEL forge-installer.jar
ECHO Installation complete. forge-installer.jar deleted.
)

) ELSE (
ECHO forge-installer.jar not found. Maybe the Forges servers are having
trouble.
ECHO Please try again in a couple of minutes.
)
) ELSE (
ECHO forge.jar present. Moving on...
)

IF NOT EXIST minecraft_server.%MINECRAFT%.jar (


ECHO Minecraft Server JAR-file not found. Downloading...
powershell -Command "(New-Object
Net.WebClient).DownloadFile('https://launcher.mojang.com/v1/objects/
1b557e7b033b583cd9f66746b7a9ab1ec1673ced/server.jar', 'minecraft_server.%MINECRAFT
%.jar')"
) ELSE (
ECHO minecraft_server.%MINECRAFT%.jar present. Moving on...
)

IF NOT EXIST eula.txt (


ECHO Mojang's EULA has not yet been accepted. In order to run a Minecraft server,
you must accept Mojang's EULA.
ECHO Mojang's EULA is available to read at
https://account.mojang.com/documents/minecraft_eula
ECHO If you agree to Mojang's EULA then type "I agree"
set /P "Response="
IF "%Response%" == "%AGREE%" (
ECHO User agreed to Mojang's EULA.
ECHO #By changing the setting below to TRUE you are indicating your agreement
to our EULA ^(https://account.mojang.com/documents/minecraft_eula^).> eula.txt
ECHO eula=true>> eula.txt
) else (
ECHO User did not agree to Mojang's EULA.
)
) ELSE (
ECHO eula.txt present. Moving on...
)

ECHO Starting server...


ECHO Minecraft version: %MINECRAFT%
ECHO Forge version: %FORGE%
ECHO Java version:
%JAVA% --version
ECHO Java args: %ARGS%

%JAVA% "%OTHERARGS%" %ARGS% -jar forge.jar nogui

PAUSE

You might also like