Back to mods
ReactiveUI project artwork

CurseForge · Hytale mod

ReactiveUI

A simple, reactive UI framework that offers better event handling, easy UI data-binding, and reusable components for making complex & dynamic user interfaces in Hytale!

Choose a version Pick your version below, then grab the matching file.

Quick answer

Which ReactiveUI release should I use?

Updated 6 months ago
Latest stable file hytale-reactiveui-1.0.jar
Game version Not listed
Mod system Built-in Hytale mod system

ReactiveUI hytale-reactiveui-1.0.jar targets Hytale. Do not install it as a separate client mod. Enable it on the world host—the local server in singleplayer or the dedicated server in multiplayer. No required dependencies listed for this file.

Where it goes

Where should ReactiveUI be installed in Hytale?

Do not install it as a separate client mod. Enable it on the world host—the local server in singleplayer or the dedicated server in multiplayer.

Separate client mod Not supported
World host / dedicated server Required
Mod system for this release Built-in Hytale mod system
Required install it here Optional supported, not mandatory Not supported do not install here Source doesn’t say do not assume

Put Hytale mods on the world host or dedicated server. Singleplayer runs a local server too; Hytale does not use separate client mods.

What else does ReactiveUI hytale-reactiveui-1.0.jar need?

hytale-reactiveui-1.0.jar. Change the file and its required mods may change too.

No required dependencies listed for this file

This file does not list any required mods. Do not add a library just because a different file uses it.

This file does not list any required or optional project dependencies. Check the creator notes before changing an existing world.

Before you install it

Add ReactiveUI without breaking your instance.

Built for ReactiveUI hytale-reactiveui-1.0.jar. Pick another file and the loader, install side or required mods may change.

  1. 01

    Stick to this file

    Use hytale-reactiveui-1.0.jar. It targets Hytale; another release may target a different game build or dependency set.

  2. 02

    Bring the mods it needs

    This file does not list any required mods. Do not add a library just because a different file uses it.

  3. 03

    Enable it on the world host

    Do not install it as a separate client mod. Enable it on the world host—the local server in singleplayer or the dedicated server in multiplayer.

  4. 04

    Pick the file you checked

    Use the “Get this file” button beside hytale-reactiveui-1.0.jar. It opens that exact file at the source.

About this project

What does ReactiveUI add?

Hytale ReactiveUI

A modern, reactive UI framework for Hytale server-side modding that simplifies UI management through automatic data binding, declarative event handling, and reusable components.

Join our Discord to get support & stay updated with new additions!

License: MIT

Hytale ReactiveUI

Features

  • Automatic Data Binding - UI updates automatically when values change
  • Declarative Event Handling - Clean, fluent API for handling UI events
  • Reusable Components - Build modular UI elements with proper lifecycle management
  • Type-Safe - Generic elements with typed parent page references
  • Array/List Support - Easy creation of dynamic lists and repeated elements
  • Event-Driven Architecture - Efficient event routing and parameter decoding

Installation

Gradle (Kotlin DSL)

repositories {
    mavenCentral()
}

dependencies {
    implementation("dev.jonrapp:hytale-reactiveui:1.0")
}

Gradle (Groovy)

repositories {
    mavenCentral()
}

dependencies {
    implementation 'dev.jonrapp:hytale-reactiveui:1.0'
}

Maven

<dependency>
    <groupId>dev.jonrapp</groupId>
    <artifactId>hytale-reactiveui</artifactId>
    <version>1.0</version>
</dependency>

Core Concepts

1. Pages

Pages are the primary entry point for UI in Hytale. ReactiveUI provides ReactiveUiPage, an enhanced page implementation that simplifies event handling, data binding, and element management. It includes built-in support for managing a "primary element", a single element that can be easily swapped out, making it perfect for tabbed interfaces or wizard-style UIs.

public class MyPage extends ReactiveUiPage {

    public MyPage(@Nonnull PlayerRef playerRef) {
        super(playerRef, CustomPageLifetime.CanDismiss);
    }

    @Override
    public void build(@Nonnull Ref<EntityStore> ref, 
                      @Nonnull UICommandBuilder commands, 
                      @Nonnull UIEventBuilder events, 
                      @Nonnull Store<EntityStore> store) {
        // Load your UI file
        commands.append("MyPage.ui");

        // Bind events
        bindEvent(
            CustomUIEventBindingType.Activating,
            "#TabButton",
            events,
            EventBinding.action("tab-clicked")
                .onEvent(context -> showPrimaryElement(new MyTab(this)))
        );

        // Show initial element
        showPrimaryElement(new MyTab(this));
    }

    @Override
    public String getRootContentSelector() {
        return "#Content";  // Where primary elements are displayed
    }
}

2. Elements

Elements are reusable UI components that manage their own lifecycle, events, and data bindings.

public class MyElement extends Element<MyPage> {

    public MyElement(MyPage pageRef) {
        super(pageRef);
    }

    @Override
    protected void onCreate(String root, UICommandBuilder commands, UIEventBuilder events) {
        // Load element UI
        commands.append(root, "MyElement.ui");

        // Bind button click event
        bindEvent(
            CustomUIEventBindingType.Activating,
            "#SubmitButton",
            events,
            EventBinding.action("submit-clicked")
                .onEvent(context -> handleSubmit())
        );
    }

    private void handleSubmit() {
        // Handle the event
    }
}

3. Event Binding

ReactiveUI provides a fluent API for binding events to UI elements with automatic cleanup.

// Simple event binding
bindEvent(
    CustomUIEventBindingType.Activating,
    "#Button",
    events,
    EventBinding.action("button-clicked")
        .onEvent(context -> {
            // Handle click
        })
);

// Event with parameters
bindEvent(
    CustomUIEventBindingType.Activating,
    "#ItemButton",
    events,
    EventBinding.action("item-selected")
        .withEventData("itemId", Codec.STRING, "item_123")
        .onEvent(context -> {
            String itemId = context.getParameter("itemId");
            // Use the parameter
        })
);

// Conditional event handling (return true if handled)
bindEvent(
    CustomUIEventBindingType.Activating,
    "#ConditionalButton",
    events,
    EventBinding.action("conditional-action")
        .onEventConditional(context -> {
            if (someCondition()) {
                // Handle event
                return true;  // Event consumed
            }
            return false;  // Continue to next handler
        })
);

4. Automatic Data Binding

Use @UIBinding annotations for automatic UI updates when values change.

public class PlayerCard extends Element<MyPage> {

    @UIBinding(selector = "#PlayerName.TextSpans")
    private UIBindable<String> playerName;

    @UIBinding(selector = "#PlayerScore.TextSpans")
    private UIBindable<String> score;

    public PlayerCard(MyPage pageRef) {
        super(pageRef);
    }

    @Override
    protected void onCreate(String root, UICommandBuilder commands, UIEventBuilder events) {
        commands.append(root, "PlayerCard.ui");

        // Set initial values
        playerName.set("Steve");
        score.set("100");
    }

    public void updateScore(int newScore) {
        // UI automatically updates when you call set()
        score.set(String.valueOf(newScore));
    }
}

Key Points:

  • Fields are automatically initialized by the framework
  • Calling set() immediately updates the UI
  • Use set(value, commands) to batch multiple updates together
  • Supports String, Message, or any type (converted via toString())

5. Array/List Elements

Create multiple instances of elements for lists, inventories, or repeated patterns.

public class ItemList extends Element<MyPage> {

    public ItemList(MyPage pageRef) {
        super(pageRef);
    }

    @Override
    protected void onCreate(String root, UICommandBuilder commands, UIEventBuilder events) {
        commands.append(root, "ItemList.ui");

        // Create 10 item elements
        for (int i = 0; i < 10; i++) {
            ItemElement item = new ItemElement(pageRef, i);
            item.create("#ItemContainer", i, commands, events);
        }
    }
}

public class ItemElement extends Element<MyPage> {

    private final int index;

    @UIBinding(selector = "#ItemIndex.TextSpans")
    private UIBindable<String> itemIndex;

    public ItemElement(MyPage pageRef, int index) {
        super(pageRef);
        this.index = index;
    }

    @Override
    protected void onCreate(String root, UICommandBuilder commands, UIEventBuilder events) {
        commands.append(root, "ItemElement.ui");

        // Set the index value (batched with creation)
        itemIndex.set(String.valueOf(index), commands);
    }
}

How it works:

  • create(root, index, commands, events) creates a container with an indexed selector
  • Each instance gets a unique selector like #ItemElement0, #ItemElement1, etc.
  • Data bindings are scoped to each instance automatically

Advanced Usage

Type-Safe Page References

Elements are generic and provide type-safe access to their parent page:

public class MyElement extends Element<MySpecificPage> {

    public MyElement(MySpecificPage pageRef) {
        super(pageRef);
    }

    @Override
    protected void onCreate(String root, UICommandBuilder commands, UIEventBuilder events) {
        // Access page-specific methods with full type safety
        pageRef.someCustomMethod();
    }
}

Manual Event Registration

For more control, register event handlers directly:

registerEventHandler("my-action", EventHandlerBuilder.create()
    .withParameter("playerId", Codec.STRING)
    .build(context -> {
        String playerId = context.getParameter("playerId");
        // Handle event
    })
);

Lifecycle Management

Elements automatically clean up their event handlers when unloaded:

@Override
public void onUnload() {
    super.onUnload();  // Cleans up all registered events
    // Add custom cleanup here
}

Examples

Check out the examples directory for complete working examples including:

  • Tabbed interface with primary element switching
  • Dynamic lists with iterated elements
  • Data binding with automatic UI updates
  • Event handling with parameters

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Migrating From Old Version (HyUI)

If you're migrating from the previous iteration of this project (HyUI), the only thing that has changed is naming of the Page class and packages:

HyUiPage -> ReactiveUiPage

import dev.jonrapp.hyui. -> import dev.jonrapp.hytaleReactiveUi.

Links

Project description from CurseForge.

Recent files

ReactiveUI releases and Hytale builds

1 of 1 releases match

Looking for an older file? The official CurseForge project page is in Resources.