Background

HyRestart

ModsHyRestart
HyRestart

HyRestart

CurseForge
UtilityMiscellaneous

Automatic restarts for Hytale servers with Discord integration.

šŸ”„ HyRestart - Automatic Server Restart Plugin

A comprehensive and configurable automatic restart plugin for Hytale servers with Discord integration and customizable warning messages.


šŸ“– Why?

Server stability is crucial for multiplayer games. Regular restarts help maintain performance, clear memory leaks, and apply updates. HyRestart automates this process with:

  • Scheduled restarts at configurable times
  • Progressive player warnings before restarts
  • Discord webhook notifications
  • Fully customizable messages

Whether you're running a small community server or a large Hytale network, HyRestart ensures smooth, predictable server maintenance without surprising your players!


✨ Features

šŸ• Scheduled Restarts

  • Configure multiple daily restart times (24-hour format)
  • Configurable restart threshold and delays

āš ļø Player Warnings

  • Customizable warning intervals (30min, 15min, 5min, 1min by default)
  • Broadcast messages to all online players
  • Configurable warning messages with placeholders

šŸ”” Discord Integration

  • Rich embed notifications via webhooks
  • Customizable embed titles, descriptions, and colors
  • Separate messages for warnings and final restart
  • Time placeholder support

šŸ”§ Fully Configurable

  • All messages configurable in config.yml
  • System log messages customizable
  • Warning intervals and messages
  • Discord webhook settings
  • Easy to translate to any language

šŸ“„ Installation

1ļøāƒ£ Download the plugin

# Download HyRestart-1.0-SNAPSHOT.jar from releases

2ļøāƒ£ Install on your server

# Place the JAR in your mods folder
cp HyRestart-1.0-SNAPSHOT.jar /path/to/hytale/mods/

3ļøāƒ£ Start your server
The plugin will automatically create a default config.yml in mods/HyRestart/

4ļøāƒ£ Configure your settings
Edit mods/HyRestart/config.yml to customize restart times, messages, and Discord integration


āš™ļø Configuration

Basic Configuration

# Restart times (24h format: HH:mm)
restartTimes:
  - "03:00"
  - "09:00"
  - "15:00"
  - "21:00"

# Cooldown after a restart to prevent immediate re-restart loops (seconds)
restartCooldownSeconds: 60

# Final restart message
finalRestartMessage: "[Restart] Restarting server NOW!"

Warning Configuration

# Restart warnings
warnings:
  - seconds: 1800  # 30 minutes
    message: "[Restart] The server will restart in 30 minutes."
    discordTime: "30 minutes"
  - seconds: 900   # 15 minutes
    message: "[Restart] The server will restart in 15 minutes."
    discordTime: "15 minutes"
  - seconds: 300   # 5 minutes
    message: "[Restart] The server will restart in 5 minutes. Get ready!"
    discordTime: "5 minutes"
  - seconds: 60    # 1 minute
    message: "[Restart] The server will restart in 1 minute. DISCONNECT NOW!"
    discordTime: "1 minute"

Discord Integration

discord:
  enabled: true
  webhookUrl: "https://discord.com/api/webhooks/YOUR_WEBHOOK_URL"
  embedTitle: "šŸ”„ Server Restart"
  embedDescription: "The server will restart in **{time}**.\n\nPlease save your progress and disconnect."
  embedColor: 16711680  # Red color in decimal
  finalEmbedTitle: "āš ļø SERVER RESTARTING"
  finalEmbedDescription: "The server is restarting NOW.\n\nThe server will be back in a few minutes."

šŸŽÆ Placeholder System

HyRestart supports placeholders in messages for dynamic content:

  • {time} - Restart time or time remaining
  • {count} - Number of players
  • {message} - Message content
  • {error} - Error details
  • {username} - Player username
  • {code} - Response code
  • {discordTime} - Human-readable time for Discord

Example:

broadcastingToPlayers: "[HyRestart] Broadcasting to {count} players: {message}"

šŸš€ Building from Source

1ļøāƒ£ Clone the repository

git clone https://github.com/alesixdev/HyRestart.git
cd HyRestart

2ļøāƒ£ Add libraries

Add HytaleServer.jar on libraries

3ļøāƒ£ Build with Gradle

./gradlew clean build

4ļøāƒ£ Ready!

# The built plugin will be at:
build/libs/HyRestart-1.0-SNAPSHOT.jar

šŸ”§ Development

Project Structure:

HyRestart/
ā”œā”€ā”€ src/main/
│   ā”œā”€ā”€ java/dev/alesixdev/hyrestart/
│   │   ā”œā”€ā”€ HyRestartPlugin.java          # Main plugin entry
│   │   ā”œā”€ā”€ config/
│   │   │   ā”œā”€ā”€ ConfigManager.java        # Config loading/saving
│   │   │   ā”œā”€ā”€ ConfigData.java           # Config data model
│   │   │   └── WarningConfig.java        # Warning data model
│   │   ā”œā”€ā”€ scheduler/
│   │   │   └── RestartScheduler.java     # Restart logic
│   │   └── utils/
│   │       └── DiscordWebhook.java       # Discord integration
│   └── resources/
│       ā”œā”€ā”€ config.yml                     # Default configuration
│       └── manifest.json                  # Plugin manifest
ā”œā”€ā”€ build.gradle                           # Build configuration
└── README.md

šŸ“ž Support


šŸ“œ License

Licensed under the MIT License. Use, modify, and redistribute freely.


HyRestart - Hytale Mod | Hytale Wiki