SSCL Wiki

String Value

string()

Creates a string value.

StringValue name = category.string("name", "Example");

get()

String name = value.get();

set()

value.set("Something");

getDefault()

String defaultValue = value.getDefault();

resetToDefault()

value.resetToDefault();

comment()

value.comment("Text used by the mod");

tooltip()

Adds a tooltip for the Mod Menu UI.

Using a normal string:

value.tooltip("Explains what this text is used for");

Using a translatable component:

value.tooltip(Component.translatable("mymod.config.text.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.