Skip to content

How the Mod Works

MadaHaz edited this page Aug 30, 2025 · 1 revision

Overview and some complaining.

This mod is extremely simple, so much so that I think the core functionality works on pretty much every forge version. Probably the same for other modding frameworks as well.

The only issue is that each version of forge changes how they do the same things (lucky us), better yet, the documentation for the older versions are a PAIN to go through.

Key parts of the code.

So now onto the main part, how the code works. It's split into two parts.

Part 1:

The main java class file which handles:

  1. Initialising the logger, used to display info to the server CLI.
  2. The server start sequence, where it might shutdown on launch depending on the users config.
  3. A count players function where it checks if the server is empty, if yes, then a timer begins which will shutdown the server in the specified time from the users config.
  4. A player join function, which occurs if a player joins the server. It checks if the timer is active, if it is, it'll stop the shutdown sequence.
  5. A stopper function, where a last check for players occurs, and the server shuts down.

Part 2:

A config file which has the following editable values:

  • The shutdown time in minutes, minimum of 1 minute, has a default value of 2.
  • Shutdown on launch, either true or false, has a default value of true.

Clone this wiki locally