Gaming Bharat

Create a complete Minecraft plugin named GarudaAutoRestart for GarudaMC.

Server details:

  • Paper 1.21.11
  • Java
  • Meowlix Hosting
  • Hong Kong Node
  • Timezone: Asia/Hong_Kong (UTC+8)

CORE REQUIREMENT:

At a configurable fixed time every day, the plugin must perform the following sequence:

  1. Broadcast warning messages to all online players at 10 minutes, 5 minutes, 3 minutes, 1 minute, 30 seconds, and 10, 5, 4, 3, 2, 1 seconds before shutdown.
  2. At the configured shutdown time, gracefully and completely stop the Minecraft server.
  3. As soon as the Minecraft server has COMPLETELY STOPPED, automatically start it again immediately.
  4. There must be NO intentional waiting period between shutdown completion and startup.
  5. The server must return to ONLINE state automatically without any manual intervention.

IMPORTANT TECHNICAL REQUIREMENTS:

  • A normal Bukkit/Paper plugin cannot execute code after the JVM stops.
  • Implement this using a proper external watchdog, hosting panel API, or Meowlix startup integration.
  • Do not use Bukkit restart commands alone.
  • Do not use fake API endpoints.
  • The restart trigger must detect actual process termination before starting the server.
  • Prevent duplicate startup requests.
  • Ensure graceful shutdown and world saving.
  • Provide configurable broadcast messages.
  • Support daily scheduled shutdown.
  • Include admin commands:

/garudarestart reload /garudarestart status /garudarestart schedule

Generate complete source code, config.yml, plugin.yml, pom.xml, README.md, and compiled JAR if possible.

Explain the exact Meowlix Hong Kong node setup required for automatic restart.

Kodari AI
KodariNov 2 at 3:04 pm 1
GarudaAutoRestart
A Minecraft plugin for GarudaMC that implements a daily scheduled server restart with configurable warning broadcasts. Features countdown messages at specified intervals before shutdown, graceful server stopping with world saving, and automatic restart via a watchdog system. Includes admin commands for reloading config, checking status, and viewing the schedule. Designed for Paper 1.21.11 on Meowlix Hong Kong hosting with Asia/Hong_Kong timezone support.
  1. Add the Paper plugin with Hong Kong daily scheduling, configurable countdown broadcasts, graceful saves, and admin commands.

  2. Add a single-process shell supervisor that relaunches only after the plugin’s restart signal and Java process exit.

  3. Document deployment and the Meowlix panel capabilities that must be confirmed; avoid inventing a hosting API.

Created GarudaAutoRestart with the Paper plugin, configurable daily countdown, save-and-shutdown sequence, admin commands, Maven configuration, and a separate shell supervisor.

The supervisor starts Paper again immediately after the Java process exits, but only when the plugin has written its restart marker. This avoids relying on plugin code after JVM shutdown and avoids a second launcher from the wrapper itself.

Meowlix setup is conditional: the README gives the wrapper startup command, but I can’t verify from the node name alone whether Meowlix allows a persistent custom startup command or keeps it alive after Paper exits. The setup requires that capability; if the panel doesn’t provide it, the plugin cannot guarantee automatic restart. No unverified Meowlix API or panel feature was invented.

To get the plugin JAR, click Compile in the top bar, then Compile in the window and Download when the build succeeds. Upload the JAR to plugins, and install run-garuda-server.sh separately as described in README.md.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
README.md
run-garuda-server.sh
Code
8 381
src/main/java/com/garudamc/garudarestart/GarudaAutoRestart.java
package com.garudamc.garudarestart;

import org.bukkit.plugin.java.JavaPlugin;

public final class GarudaAutoRestart extends JavaPlugin {
    private RestartScheduler restartScheduler;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        restartScheduler = new RestartScheduler(this);
        restartScheduler.reload();
        getCommand("garudarestart").setExecutor(new RestartCommand(this, restartScheduler));
    }

    @Override
    public void onDisable() {
        if (restartScheduler != null) {
            restartScheduler.stop();
        }
    }
}