Code Patterns

Copy-paste examples for common plugin tasks. Commands, events, ECS, GUI, and more.

Gui Patterns

75
Custom Button Styling

Create custom styled buttons in native .ui files with different colors for default, hovered, and pressed states.

Custom UI Page

Create custom UI pages by extending InteractiveCustomUIPage. Define data codec for event handling.

Grave Plate Page

InteractiveCustomUIPage implementation

hytale-argumenttypeitem

Official Hytale UI: ArgumentTypeItem with text elements

hytale-bartergridspacer

Official Hytale UI: BarterGridSpacer

hytale-barterpage

Official Hytale UI: BarterPage - Container layout with buttons with text elements

hytale-bartertraderow

Official Hytale UI: BarterTradeRow - Container layout with buttons with text elements

hytale-basictextbutton

Official Hytale UI: BasicTextButton with buttons with text elements

hytale-bulletpoint

Official Hytale UI: BulletPoint with text elements

hytale-changemodelpage

Official Hytale UI: ChangeModelPage - Container layout with buttons with text elements

hytale-chestmarker

Official Hytale UI: ChestMarker - Container layout with text elements

hytale-commandlistpage

Official Hytale UI: CommandListPage - Container layout with buttons with text elements

hytale-configureinstanceblockpage

Official Hytale UI: ConfigureInstanceBlockPage - Container layout with buttons with text elements

hytale-droppeditemslot

Official Hytale UI: DroppedItemSlot with text elements

hytale-entityspawnpage

Official Hytale UI: EntitySpawnPage - Container layout with buttons with text elements with item grid

hytale-imageimportpage

Official Hytale UI: ImageImportPage - Container layout with buttons with text elements

hytale-instancelistpage

Official Hytale UI: InstanceListPage - Container layout with buttons with text elements

hytale-itemrepairelement

Official Hytale UI: ItemRepairElement with buttons with text elements

hytale-itemrepairpage

Official Hytale UI: ItemRepairPage - Container layout with buttons with text elements

hytale-launchpadsettingspage

Official Hytale UI: LaunchPadSettingsPage - Container layout with buttons with text elements

hytale-memoriescategory

Official Hytale UI: MemoriesCategory with buttons with text elements

hytale-memoriescategorypanel

Official Hytale UI: MemoriesCategoryPanel - Container layout with buttons with text elements

hytale-memoriespanel

Official Hytale UI: MemoriesPanel - Container layout with buttons with text elements

hytale-memoriesunlocked

Official Hytale UI: MemoriesUnlocked with buttons with text elements

hytale-memory

Official Hytale UI: Memory with buttons with text elements

hytale-namerespawnpointpage

Official Hytale UI: NameRespawnPointPage - Container layout with buttons with text elements

hytale-objimportpage

Official Hytale UI: ObjImportPage - Container layout with buttons with text elements

hytale-overridenearbyrespawnpointpage

Official Hytale UI: OverrideNearbyRespawnPointPage - Container layout with buttons with text elements

hytale-overriderespawnpointbutton

Official Hytale UI: OverrideRespawnPointButton with buttons with text elements

hytale-parameteritem

Official Hytale UI: ParameterItem with text elements

hytale-particlespawnpage

Official Hytale UI: ParticleSpawnPage - Container layout with buttons with text elements

hytale-pill

Official Hytale UI: Pill with text elements

hytale-playsoundpage

Official Hytale UI: PlaySoundPage - Container layout with buttons with text elements

hytale-pluginlistbutton

Official Hytale UI: PluginListButton with buttons with text elements

hytale-pluginlistpage

Official Hytale UI: PluginListPage - Container layout with buttons with text elements

hytale-portaldeviceactive

Official Hytale UI: PortalDeviceActive - Container layout with buttons with text elements

hytale-portaldeviceerror

Official Hytale UI: PortalDeviceError - Container layout with buttons with text elements

hytale-portaldevicesummon

Official Hytale UI: PortalDeviceSummon - Container layout with buttons with text elements

hytale-portals

Official Hytale UI: Portals with text elements

hytale-prefabbrowser

Official Hytale UI: PrefabBrowser with text elements

hytale-prefabeditorexitconfirm

Official Hytale UI: PrefabEditorExitConfirm - Container layout with buttons with text elements

hytale-prefabeditorsavesettings

Official Hytale UI: PrefabEditorSaveSettings - Container layout with buttons with text elements

hytale-prefabeditorsettings

Official Hytale UI: PrefabEditorSettings - Container layout with buttons with text elements

hytale-prefablistpage

Official Hytale UI: PrefabListPage - Container layout with buttons with text elements

hytale-prefabsavepage

Official Hytale UI: PrefabSavePage - Container layout with buttons with text elements

hytale-prefabspawnersettingspage

Official Hytale UI: PrefabSpawnerSettingsPage - Container layout with buttons with text elements

hytale-prefabteleportpage

Official Hytale UI: PrefabTeleportPage - Container layout with buttons with text elements

hytale-respawnpage

Official Hytale UI: RespawnPage - Container layout with buttons with text elements

hytale-scriptedbrushlistpage

Official Hytale UI: ScriptedBrushListPage - Container layout with buttons with text elements

hytale-selectoverriderespawnpointpage

Official Hytale UI: SelectOverrideRespawnPointPage - Container layout with buttons with text elements

hytale-shopelementbutton

Official Hytale UI: ShopElementButton with buttons

hytale-shoppage

Official Hytale UI: ShopPage - Container layout with buttons with text elements

hytale-subcommandcard

Official Hytale UI: SubcommandCard with buttons with text elements

hytale-teleporter

Official Hytale UI: Teleporter - Container layout with buttons with text elements

hytale-tintchunkpage

Official Hytale UI: TintChunkPage - Container layout with buttons with text elements

hytale-variantcard

Official Hytale UI: VariantCard with buttons with text elements

hytale-warpentrybutton

Official Hytale UI: WarpEntryButton with buttons with text elements

hytale-warplistpage

Official Hytale UI: WarpListPage - Container layout with buttons with text elements

Index Dialog

InteractiveCustomUIPage implementation

Location HUD

CustomUIHud implementation

Map Vote Page

InteractiveCustomUIPage implementation

Mute Dialog

InteractiveCustomUIPage implementation

Native UI File Setup

Set up native .ui files for custom UI pages. Files must be in Common/UI/Custom/Pages/ in JAR but referenced as Pages/ in Java code. Requires IncludesAssetPack in manifest.

Player Current Role HUD

CustomUIHud implementation

Player Dialog

InteractiveCustomUIPage implementation

Score Board Page

BasicCustomUIPage implementation

Shop Page

InteractiveCustomUIPage implementation

Stats Dialog

InteractiveCustomUIPage implementation

Stick Dialog

InteractiveCustomUIPage implementation

UI Common Components

Reference built-in Hytale UI components from Common.ui in your custom .ui files.

UI Dropdown

Create dropdown menus in custom UI with selectable options.

UI Label Styling

Style labels in native .ui files with custom fonts, colors, and alignment.

Warp Dialog

InteractiveCustomUIPage implementation

Waypoint Edit Page

InteractiveCustomUIPage implementation

Whitelist Dialog

InteractiveCustomUIPage implementation