Supercharge Your Hytale Modding Workflow with mdevtools

Tired of restarting your server every time you change a line of code?

In this guide, we’ll set up mdevtools to enable hot-reloading for your Hytale modding environment. By creating a tight loop between your Gradle build and your running server, you can iterate faster and stay in the flow.

I’m actively using this exact workflow right now to build the procedural generation systems for Vex’s Dungeon Challenge. When you are tweaking complex dungeon logic or iterating on gameplay mechanics, saving those 30-second restart loops saves hours of development time every week.

Here is how to set it up.

1. Download and Install mdevtools

First, grab the latest mdevtools jar file from CurseForge:

Download mdevtools

Where to place the jar:

Depending on your project structure, place the downloaded jar in the following location:

Project Type Destination Path
Standard Template (mbround18) data/server/Server/builtin
Custom Setup Create a builtin folder in your server root and drop it there.

2. Configure Your Manifest

To ensure the mod loads correctly without crashing, verify that your hytale-mod.json (or equivalent manifest) contains the dependency fields.

Add the following to your manifest:

"Dependencies": {},
"OptionalDependencies": {}

Note: For single-mod development, leaving these objects empty is perfectly fine. They just need to be present.

3. Automate the Copy Process with Gradle

We need a way to move your compiled jar into the server’s mods folder automatically. Add this task to your build.gradle file.

This snippet creates an installModJar task that builds your jar and immediately copies it to the server directory:

// In build.gradle
tasks.register("installModJar", Copy) {
    // 1. Build the jar first
    dependsOn ":plugins:yourmod:jar" 

    // 2. Grab the output file
    from { project(":plugins:yourmod").tasks.named("jar").flatMap { it.archiveFile } }

    // 3. Drop it into the server mods folder
    into file("data/server/Server/mods")
}

4. The “Hot Reload” Script

Finally, we tie it all together with a lightweight Bash script. This allows you to rebuild and replace the jar without restarting your Docker container.

Save this as dev-reload.sh in your project root and make it executable (chmod +x dev-reload.sh).

#!/bin/bash
set -euo pipefail
IFS=$'nt'

# Configuration
WATCH_DIR="plugin/src"
BUILD_TASK="installModJar" # Updated to match the Gradle task above
JAR_NAME="plugin-name-0.1.0.jar"
JAR_SOURCE="./plugin/build/libs"
JAR_DEST="data/server/Server/mods"
DEBOUNCE_SECONDS=5

last_build_time=0

build_and_copy() {
  # Run the gradle task we created in Step 3
  ./gradlew "$BUILD_TASK" 
}

hard_reload() {
  build_and_copy
  # NOTE: UI assets do NOT hot reload. 
  # If you have new UI files, uncomment lines below to rebuild assets zip.
  # ./gradlew assetsZip 
  #    && cp "dist/$(ls dist | grep -m1 -E 'assets.*.zip')" "$JAR_DEST/"

  echo "Restarting Docker container..."
  docker compose restart
  echo "Hard reload complete."
}

echo "=========================================================="
echo " Hytale Dev Loop: Ready."
echo " [r] Reload Code (Hot)"
echo " [h] Hard Reload (Restart Container + UI)"
echo " [e] Exit"
echo "=========================================================="

while true; do
  printf "> "
  IFS= read -r -n1 key
  echo
  case "$key" in
    r|R)
      now=$(date +%s)
      if (( now - last_build_time < DEBOUNCE_SECONDS )); then
        echo "Debounced. Wait a moment before reloading again."
        continue
      fi
      last_build_time=$now
      echo "Rebuilding and hot-swapping..."
      build_and_copy
      ;;
    h|H)
      echo "Hard reload requested..."
      hard_reload
      ;;
    e|E)
      echo "Exiting."
      break
      ;;
    *)
      # Ignore other keys
      ;;
  esac
done

5. Bonus: Better UI Development

While mdevtools handles your Java code hot-reloading, writing Hytale UI files (.ui) can still be tricky. The game requires a Hard Reload to see UI changes, so you want to catch errors before you restart.

I’ve built a VS Code extension specifically to solve this:

Hytale UI Ultimate

I use this tool to build the interfaces for Vex’s Dungeon Challenge. It provides:

  • Syntax Highlighting for .ui files.
  • Diagnostics to catch invalid group naming and missing attributes.
  • Import Navigation (Ctrl+Click) to jump between UI files.

Pairing this extension with the Hard Reload (h) script above gives you the most robust workflow currently possible.

Summary

You now have a terminal dashboard for development. Instead of manually moving files or waiting for long boot times, you can simply press r to inject your new code instantly.

Happy Modding!

Leave a Reply