Home›Java›Mods›Calyren's Utils
Calyren's Utils
ModsJava

Calyren's Utils

Java mod listed for Minecraft 26.x. Downloads from the MC Java Mods app on Android.

by Calyren · on Modrinth

⬇ Download on Modrinth

CXD's Utilities

Instalation

build.gradle:

repositories {
	exclusiveContent {
		forRepository {
			maven {
				name = "Modrinth"
				url = "https://api.modrinth.com/maven"
			}
		}
		filter {
			includeGroup "maven.modrinth"
		}
	}
}

dependencies {
    implementation "maven.modrinth:t9HzrmQg:<version_id>"
}

Replace with an actual Version ID. (Ex. For 1.0-26.2, the Version ID is "2k1jbG7k")


Q: Where do I find the Version ID?

A: Go to the version you want install and then click on "Developer information". You should find the Version ID there.

Version ID

Mob Effects

CXD's Utils adds 3 classes related to Mob Effects:


CustomEffectDuration

CustomEffectDuration lets you set a custom duration text for Mob Effects.

public class YourMobEffect extends MobEffect implements CustomEffectDuration {
<...>

    @Override
    public Component getDurationText(MobEffectInstance instance) {
        return Component.literal("Hi!!! This is an Example!")
                .withStyle(style -> style.withColor(0xFFFFFF));
    }

}

Instead of showing how long the effect lasts, it will display:

Hi!!! This is an Example!

CustomEffectTooltip

CustomEffectTooltip lets you add a custom tooltip to Mob Effects.

public class YourMobEffect extends MobEffect implements CustomEffectTooltip {
<...>

    @Override
    public List<Component> getTooltipLines(MobEffectInstance instance) {
        return List.of(
                Component.literal("This Text will appear when you hover over the Effect!")
                        .withStyle(ChatFormatting.WHITE),
                Component.literal("It also supports multiple lines!")
                        .withStyle(ChatFormatting.WHITE)
        );
    }

}

When hovering over the Mob Effect, the custom tooltip text will appear.


StatusEffectBackground

CustomEffectTooltip lets you add a custom texture to your MobEffect's background.

public class YourMobEffect extends MobEffect implements StatusEffectBackground {
<...>

    @Override
    public Identifier inventorySprite() {
        return Identifier.fromNamespaceAndPath(YourMod.MOD_ID, "container/inventory/
effect_background");
    }
    @Override
    public Identifier ambientInventorySprite() {
        return Identifier.fromNamespaceAndPath(YourMod.MOD_ID, "container/inventory/
effect_background_ambient");
    }

}

Check https://mcasset.cloud/26.1.2/assets/minecraft/textures/gui/sprites/container/inventory to see how Minecraft does the effect backgrounds. This uses the same logic.

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

File checked by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more