Skip to content

Utilities

Bizarre Cube edited this page Aug 14, 2026 · 2 revisions

The library includes client-side utilities that work independently of the Minecraft version.

Id — identifiers

Identifier id  = Id.withDefaultNamespace("thing");  
Identifier id2 = Id.fromNamespaceAndPath("mymod", "thing");  

ComponentBuilder — text components

A fluent builder for Component: literal, translatable, empty, formatting
(bold, italic, underline, strikethrough, obfuscated, color, format),
as well as clickEvent, hoverEvent, insertion.

Component c = ComponentBuilder.literal("Hello")  
        .color(ChatFormatting.GOLD)  
        .bold()  
        .build();  

ClickEventBuilder / HoverEventBuilder

ClickEvent click = ClickEventBuilder.create().copyToClipboard("text").build();  
HoverEvent hover = HoverEventBuilder.create().showText("tooltip").build();  

Keymapper — keybinds with automatic registration

public static final KeyMapping OPEN = Keymapper.register(  
        "key.mymod.open",  
        InputConstants.KEY_H,  
        Keymapper.getCategoryId("misc"));  

Keymapper.register(...) adds the binding to a queue; the library registers it
at the appropriate loader stage (for Forge/NeoForge — via an event, for Fabric — directly).

Clone this wiki locally