Context float provider

Helpers that build a minecraft:context_float_provider object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. Click a type to see what it accepts.

Abs

Abs
Abs(input)
input
FloatRef

Add

Add
Add(inputs)
inputs
AggregateOperands

Avg

Avg
Avg(inputs)
inputs
AggregateOperands

Ceil

Ceil
Ceil(input)
input
FloatRef

Conditional

Conditional
Conditional(condition, on_true, on_false?)
condition
PredicateRef
on_true
FloatRef
on_falseoptional
FloatRef

Defaults to constant 0.

Constant

Constant
Constant(value)
value
number

Cos

Cos
Cos(input)
input
FloatRef

Div

Div
Div(left, right)
left
FloatRef
right
FloatRef

EnchantmentLevel

EnchantmentLevel
EnchantmentLevel(amount)
amount
LevelBasedValue

EnvironmentAttribute

EnvironmentAttribute
EnvironmentAttribute(attribute)
attribute
NumericalEnvironmentAttribute

Floor

Floor
Floor(input)
input
FloatRef

FromInt

FromInt
FromInt(input)
input
IntRef

Length

Length
Length(inputs)
inputs
AggregateOperands

Max

Max
Max(inputs)
inputs
AggregateOperands

Min

Min
Min(inputs)
inputs
AggregateOperands

Mod

Mod
Mod(left, right)
left
FloatRef
right
FloatRef

Mul

Mul
Mul(inputs)
inputs
AggregateOperands

Negate

Negate
Negate(input)
input
FloatRef

NumberDispatcher

NumberDispatcher
NumberDispatcher(cases, default?)
cases
list of { condition: PredicateRef, value: FloatRef }

Each condition is tested in order, the first in the list that passes is used.

defaultoptional
FloatRef

Defaults to constant 0.

Pow

Pow
Pow(base, exponent)
base
FloatRef
exponent
FloatRef

Round

Round
Round(input)
input
FloatRef

Sin

Sin
Sin(input)
input
FloatRef

Sqrt

Sqrt
Sqrt(input)
input
FloatRef

Storage

Storage
Storage(storage, path, fallback?)
storage
storage id
path
string
fallbackoptional
FloatRef

Defaults to constant 0.

Sub

Sub
Sub(left, right)
left
FloatRef
right
FloatRef

Truncate

Truncate
Truncate(input)
input
FloatRef

Uniform

Uniform
Uniform(min, max)
min
FloatRef
max
FloatRef

WeightedList

WeightedList
WeightedList(distribution)
distribution
NonEmptyWeightedList of FloatRef