Skip to content

Utilities and QoL

ProstStuff edited this page Jul 10, 2026 · 4 revisions

Simple Identifiers

Simple identifier (SimpleIdentifier) is a class similar to Minecraft's Identifier. The only difference is that simple identifier does not have a character restriction.


Colors

Utilitary provide two new classes for handling colors. These two classes can be accessed from the utility folder. Colors have their own codec and stream codec, they are saved in hex string format and streamed as an integer value.

ColorRGB

The color class that only handle RGB values.

import dev.proststuff.utilitary.api.utility.ColorRGB;

// new ColorRGB(red, green, blue)
new ColorRGB(255, 255, 255)
new ColorRGB(1.0F, 1.0F, 1.0F)
new ColorRGB(0xFFFFFF)
new ColorRGB("FFFFFF")
ColorRGB color = ColorRGB(0x80FFFF)

color.get(255) // Returns the color in integer value with the provided argument as alpha value.
color.toString() // Returns the color in RRGGBB format

color.red() // Returns red integer value between 0-255
color.green() // Returns green integer value between 0-255
color.blue() // Returns blue integer value between 0-255

color.withAlpha(255) // Returns either the instance itself (if alpha matched) or a new instance as ColorARGB

ColorARGB

An extension of ColorRGB with an additional alpha field.

import dev.proststuff.utilitary.api.utility.ColorARGB;

// new ColorARGB(alpha, red, green, blue)
new ColorARGB(255, 255, 255, 255)
new ColorARGB(1.0F, 1.0F, 1.0F, 1.0F)
new ColorARGB(0xFFFFFFFF)
new ColorARGB("FFFFFFFF")
ColorARGB color = ColorARGB(0x80FFFF)

color.get() // Returns the color in integer value with the alpha field
color.toString() // Returns the color in AARRGGBB format

color.alpha() // Returns the alpha value between 0-255

Entity Render State UUID Access

EntityRenderState (and its extension) now have an additional field that stores an entity's UUID. This field can be accessed from UUIDRenderStateHolder

import dev.proststuff.utilitary.api.client.UUIDRenderStateHolder

UUID entityUUID = ((UUIDRenderStateHolder) state).utilitary$getUUID();

Clone this wiki locally