Skip to content
/ HudMan Public

a client side minecraft mod that I’ve created in my free time for mc1.20.1 the main feature of the mod is To allow the user to create custom HUD using a config file written in Json.

License

Notifications You must be signed in to change notification settings

tetex7/HudMan

Repository files navigation

Important

If encountering bugs and unusual crashing
please report them

Hud Manager

a client side minecraft mod that I’ve created in my free time for mc1.21.4
the main feature of the mod is To allow the user to create custom HUD using a config file written in Json.
This mod is quite small, only having one dependency and that is the Fabric API and technically Minecraft itself.
This mod is also expandable by external plug-in mods using the Element registry system.


here is a test config:

{
    "ver":"v1.0",
    "elements": [
        {
            "elementId": "hudman:velocity_vector",
            "cords": {"x": 100, "y": 110},
            "width": 0,
            "height": 0,
            "scale": 0.75,
            "pairGameHudElement": "minecraft:hotbar",
            "enable": true,
            "strings": [
                "doTooltip"
            ]
        }
    ],
    "debug": false,
    "errorNotification": false
}   



Also here's some syntax on how to make your own element written of Java of course I do not recommend writing this in Kotlin
import com.trs.hudman.confg.JsonConfigHudElement;
import com.trs.hudman.gui.hudmods.AbstractHudElement;
import com.trs.hudman.gui.hudmods.widget.FlowMeterWidget;
import com.trs.hudman.util.Vec2i;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

//Minecraft import's

public class Tester extends AbstractHudElement
{
    private final FlowMeterWidget TEST_FLOW_METER = new FlowMeterWidget(getCords().x(), getCords().x(), 0.5f);
    private int v = -25;
    public Tester(@Nullable AbstractHudElement root, @NotNull Minecraft client, @NotNull Vec2i rCords, @NotNull JsonConfigHudElement jsonElement)
    {
        super(root, client, rCords, jsonElement);
        TEST_FLOW_METER.addTickHandler((widget) -> {
            FlowMeterWidget this_widget = (FlowMeterWidget)widget;

            this_widget.setValue(this.v);
            this.v = v >= 25 ? -25 : v+1;
        });
    }

    @Override
    public void render(GuiGraphics guiGraphics, float partialTick, Gui gui)
    {
        TEST_FLOW_METER.render(guiGraphics, var1);
    }

    @Override
    public void tick()
    {
        TEST_FLOW_METER.widget_tick();
    }
}


And then the Register So it can be used in game

class ModClient implements ClientModInitializer
{
    public final static MODID = "test";
    void onInitializeClient()
    {
         HudState.elementRegistry.register(NamespacePath.of(MODID, "test_text"), Tester::new);
    }
}

How to add this mod to dev environment

How to add this mod to dev environment

repositories {
    ...
    //Add the modrinth repository 
    maven("https://api.modrinth.com/maven")
    ...
}

dependencies {
    ...
    //And then the mod
    modImplementation("maven.modrinth:hudman:1.6.1-mc1.21.4")
    ...
}

How to build

git clone https://github.com/tetex7/HudMan.git
cd ./HudMan
./gradlew :init
./gradlew :buildJar

This will create a folder called build_out containing two jars
The source jar is used for plugin developers to use my code base As I wrote it
The other jar is the mod Just put that in your mods folder and or put it your lib folder

About

a client side minecraft mod that I’ve created in my free time for mc1.20.1 the main feature of the mod is To allow the user to create custom HUD using a config file written in Json.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages