SSCL Wiki

Boolean Value

bool()

Creates a boolean value.

BooleanValue enabled = category.bool("enabled", true);

The second argument is the default value.

get()

Gets the current value.

boolean enabled = value.get();

set()

Changes the current value.

value.set(false);

getDefault()

Gets the default value.

boolean defaultValue = value.getDefault();

resetToDefault()

Resets the value back to its default value.

value.resetToDefault();

comment()

Adds a TOML comment.

value.comment("Whether the feature is enabled");

tooltip()

Adds a tooltip for the Mod Menu UI.

Using a normal string:

value.tooltip("Turns the feature on or off");

Using a translatable component:

value.tooltip(Component.translatable("mymod.config.enabled.tooltip"));

For the second form, add the translation key to your mod's language file. See Config Value Common APIs for the full example.

Both forms are supported.