Hytale’s modding system relies on Plugins. A plugin is a unit of code and assets that extends the game functionality.
A Hytale plugin consists of:
hytale-plugin.json: The manifest file describing the plugin.JavaPlugin.hytale.json based asset pack (models, textures, etc.).hytale-plugin.json)The PluginManifest defines metadata and dependencies.
{
"group": "com.example",
"name": "MyPlugin",
"version": "1.0.0",
"main": "com.example.MyPluginClass",
"dependencies": {
"Hytale:ImageLibrary": "1.0.0"
},
"includesAssetPack": true
}
com.example.MyPlugin).JavaPlugin.JavaPlugin ClassThe entry point for your code. Use com.hypixel.hytale.server.core.plugin.JavaPlugin.
public class MyPlugin extends JavaPlugin {
public MyPlugin(JavaPluginInit init) {
super(init);
}
@Override
protected void setup() {
// Called during setup phase
// Register commands, listeners, etc.
}
@Override
protected void start() {
// Called when server starts
}
@Override
protected void shutdown() {
// Cleanup
}
}
The PluginBase class provides access to all major registries:
getCommandRegistry(): Register custom commands.getEventRegistry(): Listen to game events.getAssetRegistry(): Register custom assets (programmatically).getEntityRegistry(): Manage entities.getTaskRegistry(): Schedule tasks.configs: Load configuration files via withConfig().Plugins can define strongly-typed configurations using Hytale’s Codec system.
Config<MyConfig> config = withConfig("config", MyConfig.CODEC);
Events are handled by the EventRegistry. You can listen to lifecycle events, ECS events, and more.
Key Events:
BootEvent: Server finished booting.ShutdownEvent: Server shutting down.JoinWorld: Player joined.PlaceBlockEvent: Block placed.BreakBlockEvent: Block broken.Plugins can bundle assets directly. If includesAssetPack is true, the server loads assets from the plugin’s jar/folder Structure:
assets/
hytale/
textures/models/The AssetRegistryLoader automatically indexes these if the structure matches Hytale’s asset format.