All Hytale server plugins must extend the com.hypixel.hytale.server.core.plugin.PluginBase class. This class provides the hook points for the server’s lifecycle events.
Your plugin should override the following methods to perform initialization and cleanup logic.
setup()getCommandRegistry().registerCommand(...)getEventRegistry().register(...)withConfig(...) or getConfig() (if available early).@Override
public void setup() {
System.out.println("MyPlugin is setting up!");
getEventRegistry().register(PlayerJoinEvent.class, event -> {
System.out.println("Player joined: " + event.getPlayer().getName());
});
}
start()@Override
public void start() {
System.out.println("MyPlugin has started!");
}
shutdown()@Override
public void shutdown() {
System.out.println("MyPlugin is shutting down!");
}
The PluginManager (com.hypixel.hytale.server.core.plugin.PluginManager) orchestrates these calls.
It ensures that dependencies are respected (if the dependency system is exposed) and that all plugins transition through SETUP -> START -> STOP in unison.