Example Hytale Plugin
This is an example Hytale server plugin demonstrating the basic structure and setup.
Project Structure
example-mod/
├── app/
│ ├── src/
│ │ ├── main/
│ │ │ ├── java/org/example/
│ │ │ │ └── ExamplePlugin.java
│ │ │ └── resources/
│ │ │ └── plugin.json
│ │ └── test/
│ ├── build.gradle.kts
├── gradle/
├── server/
├── build.gradle.kts
├── settings.gradle.kts
└── gradlew / gradlew.bat
Setup
Pre-setup
# Download the hytale-downloader & cfr (DO IT ONCE)
./setup --download
Setup
# Download the HytaleServer, finally located here ./server/HytaleServer.jar
./setup --setup
Decompile
# Decompile ./server/HytaleServer.jar to get the source, finally located here ./src-ref
./setup --decompile
Building
# Build the plugin
./gradlew build
# The JAR will be in app/build/libs/ExamplePlugin-1.0.0.jar
Installation
- Build the plugin with
./gradlew build - Copy
app/build/libs/ExamplePlugin-1.0.0.jarto your Hytale server'smods/folder - Start the server
Plugin Structure
manifest.json
The plugin manifest file defines metadata about your plugin:
{
"Group": "org.example",
"Name": "ExamplePlugin",
"Version": "1.0.0",
"Description": "An example Hytale server plugin",
"Authors": [
{
"Name": "Your Name"
}
],
"Main": "org.example.ExamplePlugin",
"ServerVersion": "*",
"Dependencies": {},
"OptionalDependencies": {},
"DisabledByDefault": false,
"IncludesAssetPack": false,
"SubPlugins": []
}
Main Plugin Class
Your plugin class extends JavaPlugin and implements lifecycle methods:
setup()- Called during server setup, register configs herestart()- Called when plugin starts, register commands/events hereshutdown()- Called when plugin stops, cleanup resources here
Requirements
- Java 25 or later
Description
Releases
1
ExampleMod 1.0.0
Latest
Languages
Java
97.2%
Shell
1.5%
PowerShell
1.3%