SSCL Wiki

Enum Value

enumValue()

Creates an enum value.

For example:

public enum CameraMode {FIRST, THIRD}

Register it like this:

EnumValue<CameraMode> mode = category.enumValue(
        "mode",
        CameraMode.class,
        CameraMode.THIRD
);

enumType()

Gets the enum class.

Class<CameraMode> type = mode.enumType();

get()

CameraMode mode = value.get();

set()

value.set(CameraMode.FIRST);

getDefault()

CameraMode defaultMode = value.getDefault();

resetToDefault()

value.resetToDefault();

comment()

value.comment("Controls the camera mode");

tooltip()

Adds a tooltip for the Mod Menu UI.

Using a normal string:

value.tooltip("Changes how the camera behaves");

Using a translatable component:

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