SSCL Wiki

Int Value

intValue()

Creates an integer value.

IntValue distance = category.intValue("distance", 4);

The second argument is the default value.

min()

Sets the minimum value.

distance.min(1);

If no minimum is provided, SSCL uses 0.

max()

Sets the maximum value.

distance.max(32);

If no maximum is provided, there is no practical maximum limit.

min()

Gets the effective minimum.

int min = distance.min();

max()

Gets the effective maximum.

int max = distance.max();

Slider Behavior

An integer becomes a slider in Mod Menu only when both min() and max() are explicitly set.

category.intValue("distance", 4)
        .min(1)
        .max(32);

If only one bound is set, or no bounds are set, Mod Menu uses an edit box instead.

rangeComment()

Controls the automatic range comment in the TOML file. Enabled by default.

With:

.min(1)
.max(32)

SSCL automatically adds the comment:

# Range: 1 - 32

To disable it, use:

.rangeComment(false)

get()

int value = distance.get();

set()

distance.set(8);

getDefault()

int defaultValue = distance.getDefault();

resetToDefault()

distance.resetToDefault();

comment()

Adds a TOML comment.

distance.comment("Maximum distance in blocks.");

tooltip()

Adds a Mod Menu tooltip.

distance.tooltip("Controls how far the feature can reach.");