You are browsing as a guest. Sign up (or log in) to start making projects!

1h 20m 6s logged

Next feature, although small, it’s an important one to get this mod 1 step closer to the level of polish I want to achieve, MORE EFFECTS!

This time I wanted to make something similar to the freezing overlay you get when you get stuck in powdered snow but for Fatal Poison.

I thought it would be easy since it should just be copying the freezing rendering but my struggle was in how I would register it. I had found a mod that added just what I wanted, an overlay applied when a status effect is applied, however of course it was on a different Minecraft version. I scrambled for 2 hours researching classes, trying to find stuff that didn’t really exist in Fabric API 1.21.1. But then I remembered that the Fabric Docs exist. 💀

So the issue was that in 1.21.1 Fabric registers HUD elements not using a specific class but rather with an event:

HudRenderCallback.EVENT.register((context,tickDeltaManager) -> {}});

Later versions use a much more modern? way of registering stuff, ex.:

HudElementRegistry.attachElementAfter(VanillaHudElements.MISC_OVERLAYS, Identifier.of(MOD_ID, "overlay"), ModClient::ExtractOverlay);

0
3

Comments 0

No comments yet. Be the first!