Skip to content

[Version 4.0] Range

Insane96 edited this page Jan 24, 2023 · 2 revisions

The Range object is used in the mod to set a min and max value of a property.
This value can also be modified with modifiers.

Range

  • range: (Object) the object that contains all the range properties or a numeric value setting both min and max to that value.
    • min: minimum value. value is an alias
    • max: maximum value. Can be omitted and will be equal to min
    • round: the decimal places to round the random value between min and max after applying modifiers

Those are the base keys, after those, modifiers objects can be added, such as Difficulty Modifier. Modifiers of integer values will have the decimal part truncated. E.g. An enchantment level of 2 when modified by difficulty goes to 3.4, the result will be 3.

This:

"range": 10

equals to:

"range": {
    "min": 10,
    "max": 10
}

that equals to:

"range": {
    "value": 10
}

Simple round example. This will round the value to the nearest integer:

"range": {
    "min": 0,
    "max": 5,
    "round": 0
}

Example

Check other properties for a few use cases

Clone this wiki locally