GithubHelp home page GithubHelp logo

garnservo / mc-startup-script Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 98 KB

A fully-customisable, modular .bat startup script for Minecraft servers

Home Page: https://www.spigotmc.org/resources/mc-startup-script.115686/

License: GNU General Public License v3.0

Batchfile 100.00%
batch batch-script bukkit minecraft minecraft-server minecraft-server-startup paper pufferfish purpur spigot batch-file minecraft-launcher minecraft-server-setup minecraft-server-setup-script minecraft-server-software server-management server-manager

mc-startup-script's Introduction

Minecraft Startup Script

GitHub Release

A fully-customisable, modular .bat startup script for Minecraft servers, where all variables can be modified on the fly and applied upon server restart.

Features

1️⃣ Toggleable auto-restart
2️⃣ Customisable JVM arguments/flags - including optional optimised preset
3️⃣ Customisable RAM allocation
4️⃣ Auto-generate+accept EULA
5️⃣ GUI toggle
6️⃣ Customisable console title
7️⃣ Discord webhook integration
8️⃣ Auto-updates with latest version from GitHub

Requirements

  • Windows OS
  • Java 17

How to Use

  1. Download the script's latest release (ensure it is saved as a '.bat').
  2. Place it in your Minecraft server's root directory.
  3. Run the script by either double clicking the file, or executing via CMD.
  4. Upon first use, the script will run you through the configuration prompts.

To edit configurations:
JVM arguments = /config/jvm_args.txt
Script config = /config/StartupScript.conf

To apply configuration changes while the script is still running (i.e. console is still open), simply restart the Minecraft server.
No need to restart the script.

Screenshots

Configuration Screenshot

Console Screenshot

Functionality

First Launch/Initial Setup

  • Prompts user for server .jar filename. Checks if the file exists.
  • Prompts user to allocate initial and maximum RAM for the server. Checks if entry is a valid value.
  • Queries user whether the server should auto-restart or not.
  • Queries user whether server should use pre-configured JVM arguments. Regardless of result, will generate file for flag storage.
  • Queries user whether to launch with GUI.
  • Queries user whether to use Discord webhooks. If yes, user inputs webhook URL.
  • Lets user confirm choices. If confirmed, continue to normal startup. If rejected, will restart initial configuration.
  • Stores configuration in /config/StartupScript.conf, and JVM args in /config/jvm_args.txt.
  • Generates auto-accepted EULA.

Normal Startup

  • Checks for updates to this script.
  • Checks for config folder, config file, and sets restart counter. If config is missing, reverts back to initial setup.
  • Checks for EULA, if non-existent, creates accepted eula.txt.
  • Reads script config file and stores contents as environment variables.
  • Displays configuration to user and initialises the server.
  • Checks for JVM arguments file, if non-existent, will create one with optimised flags. If it exists, loads the args into an environment variable.
  • Checks auto-restart config to decide launch path.

Auto-Restart Enabled

  • Launches server, changes console title to the configurable title + restart count, and (if configured) sends Discord message.
  • Upon crash or restart, increments the restart counter, reloads configuration + JVM flags, and (if configured) sends Discord message.

Auto-Restart Disabled

  • Launches server and changes console title to the configurable title, and (if configured) sends Discord message.
  • Upon crash or restart, prompts user whether to restart or exit, and (if configured) sends Discord message.

Planned

  • Improve text formatting
  • Update server .jar to latest, within Minecraft version.
    e.g. paper 1.20.4 build 460 > paper 1.20.4 > build 461

Disclaimer

By using this script, you are indicating your agreement to the Minecraft EULA.

License

GNU GPLv3

mc-startup-script's People

Contributors

garnservo avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.