2.9 KiB
title, layout
| title | layout |
|---|---|
| Hytale Plugin Documentation | hextra-home |
{{< hextra/hero-badge >}} Hytale Server API {{< /hextra/hero-badge >}}
From your first plugin to advanced features. {{< /hextra/hero-subtitle >}}
Explore the Documentation
{{< hextra/feature-grid >}} {{< hextra/feature-card title="Getting Started" subtitle="Set up your environment and create your first plugin" link="getting-started" icon="play"
}} {{< hextra/feature-card title="Core Concepts" subtitle="Registries, assets, codecs, commands, events, and tasks" link="core-concepts" icon="cube" }} {{< hextra/feature-card title="Gameplay Systems" subtitle="Farming, shops, reputation, memories, and objectives" link="gameplay-systems" icon="puzzle" }} {{< hextra/feature-card title="World" subtitle="Universes, chunks, blocks, entities, worldgen, and portals" link="world" icon="globe" }} {{< hextra/feature-card title="UI Systems" subtitle="HUD, custom pages, windows, inventory, and permissions" link="ui-systems" icon="desktop-computer" }} {{< hextra/feature-card title="Advanced" subtitle="Networking, effects, particles, and dynamic lights" link="advanced" icon="lightning-bolt" }} {{< hextra/feature-card title="Reference" subtitle="API reference, manifest schema, and registries" link="reference" icon="book-open" }} {{< /hextra/feature-grid >}}
Quick Example
Here's a simple plugin that logs a message when a player joins:
public class MyPlugin extends JavaPlugin {
@Override
public void start() {
getEventRegistry().register(PlayerConnectEvent.class, event -> {
PlayerRef playerRef = event.getPlayerRef();
getLogger().at(Level.INFO).log("Player connecting: " + playerRef.getUsername());
});
}
@Override
public void shutdown() {
getLogger().at(Level.INFO).log("Plugin is shutting down!");
}
}