A number provider is a format used while describing features to specify a source of numbers. It can often be used in places where a regular number can be specified. They can return the same or a different number each time the world generator asks them for one.
There are six types of number providers: constants, two types of random number generators, world values, operations and bounded values. Most types allow for nesting as other number providers may be used to configure them.
A constant number provider provides the same value each time. It is equivalent to simply specifying a number. It is an object with the following value.
Name | Type | Default | Description |
---|---|---|---|
value |
Number | - | The number to provide. |
This type of number provider generates random numbers between a minimum and a maximum value, where each possible result is equally likely. It is an object with the following values.
Name | Type | Default | Description |
---|---|---|---|
min |
Number / number provider | - | The lower limit of the randomly generated numbers. |
max |
Number / number provider | - | The upper limit of the randomly generated numbers. |
This type of number provider generates random numbers spread around the number
0
, based on a number called variance
. It does so by generating two random
numbers between 0
(inclusive) and variance
(exclusive) and subtracting the
first from the second. Due to this method, numbers closer to 0
are more likely
to be generated.
This number provider is an object with the following value.
Name | Type | Default | Description |
---|---|---|---|
variance |
Number / number provider | - |
Used as both the upper and lower limit of the randomly
generated numbers. For example, when set to 3 , numbers
between -3 and 3 (not including those two) may be
generated.
|
A world value number provider returns values from the world that features are being generated in. It is an object with the following value.
Name | Type | Default | Description |
---|---|---|---|
world-data |
String | - | The name of the world value to provide. |
The following world values are available:
WORLD_HEIGHT
SEA_LEVEL
GROUND_LEVEL
RAIN_HEIGHT
HIGHEST_BLOCK
SURFACE_BLOCK
HEIGHT_MAP
LOWEST_CHUNK_HORIZON
SPAWN_X
SPAWN_Y
SPAWN_Z
CURRENT_X
CURRENT_Y
CURRENT_Z
An operation number provider performs an operation using two given values. It can perform various types of operations such as addition and multiplication. It is an object with the following values.
Name | Type | Default | Description |
---|---|---|---|
value-a |
Number / number provider | - | The first value in the operation. |
value-b |
Number / number provider | - | The second value in the operation. |
operation |
String | - | The type of operation to perform. |
The following operation types are available:
ADD
SUBTRACT
MULTIPLY
DIVIDE
MODULO
MINIMUM
MAXIMUM
A bounded number provider applies a minimum and maximum value to a given value, increasing it when it is too low and decreasing it when it is too high. It is an object with the following values.
Name | Type | Default | Description |
---|---|---|---|
value |
Number / number provider | - | The value to apply a minimum and maximum value to. |
min |
Number / number provider | - | The minimum value. |
max |
Number / number provider | - | The maximum value. |
Coming soon…