Back to mods
CodecLib project artwork

CurseForge · Hytale mod

CodecLib

A simpler way to use Hytale config codecs

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

Quick answer

Which CodecLib release should I use?

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

codeclib-1.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 CodecLib 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 codeclib-1.1.0.jar need?

codeclib-1.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 CodecLib without breaking your instance.

Built for codeclib-1.1.0.jar. Pick another file and the loader, install side or required mods may change.

  1. 01

    Stick to this file

    Use codeclib-1.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 codeclib-1.1.0.jar. It opens that exact file at the source.

About this project

What does CodecLib add?

CodecLib

CodecLib is a lightweight Hytale config library that automates the creation of BuilderCodec using reflection. It allows you to create complex configuration files and data structures using simple POJOs (Plain Old Java Objects), without manually defining every field and codec.


🚀 Usage

1. Basic Configuration

Create a class with the fields you want to serialize. You can initialize them to set default values.

/**
 * RULES:
 * 1. Fields MUST NOT be final, static or transient.
 * 2. Fields MUST start with an uppercase letter (Hytale Config convention).
 * 3. Be sure that the custom class you use are annotated with @Configuration as well.
 */
@Configuration
public class MyConfig {

    private String ExampleField = "defaultValue";

    @FieldName("DifferentName") //Inside config.json this field will be named "DifferentName"
    private String exampleFieldButWithDifferentName = "defaultValue2";

    @SkipConfigField //This will skip the field for serialization
    private String thisFieldWillNotExist = "defaultValue3";

    private int ExampleIntField = 42;
}

2. Generating the Codec

Use the CodecFactory to generate the codec and load your config.

// ... inside your plugin ...

public CodecLibPlugin(@Nonnull JavaPluginInit init) {
    super(init);
    instance = this;
    //Optionally, you can register your own codecs for your types
    CodecFactory.registerCustomCodec(Path.class, Codec.PATH);
    //Just use CodecFactory.createClassCodec(YourClass.class) as Codec
    CONFIG = withConfig("yourcustomconfig", CodecFactory.createClassCodec(ExampleConfig.class));
}

@Override
protected void setup() {
    CONFIG.save();//You can save normally like this
    assert Objects.equals(CONFIG.get().getExampleField(), "defaultValue");
    assert Objects.equals(CONFIG.get().getExampleIntField(), 42);
    assert Objects.equals(CONFIG.get().getExampleFieldButWithDifferentName(), "defaultValue2");
}

3. Nested Objects

You can put objects inside other objects. CodecLib will recursively generate codecs for them.

@Configuration
public class DatabaseConfig {
    public String Host = "localhost";
    public int Port = 3306;
}
@Configuration
public class MainConfig {
    public String PluginName = "MyPlugin";

    // This will be automatically handled!
    public DatabaseConfig Database = new DatabaseConfig();
}

📦 Installation

Replace with your actual JitPack/Maven instructions if hosted, otherwise shade or copy the library.

Gradle (Groovy)

repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation 'com.github.Emibergo02:CodecLib:main-SNAPSHOT'
}
//It is suggested to relocate the package in your project
shadowJar {
    relocate 'dev.unnm3d.codeclib', 'your.package.name.codeclib'
}

✅ Supported Types

The library automatically resolves codecs for the following types:

  • String, Boolean, Integer, Double, Long, Float, Byte, Short
  • UUID, Instant
  • String[], int[], double[], long[], float[]
  • Any other Class (via recursion)
  • More are coming, stay tuned

📋 Requirements

  • Java 25+
  • Hytale Server API (for BuilderCodec, Codec, etc.)

Project description from CurseForge.

Recent files

CodecLib releases and Hytale builds

2 of 2 releases match

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