Context int provider

Helpers that build a minecraft:context_int_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
IntRef

Add

Add
Add(inputs)
inputs
AggregateOperands

Avg

Avg
Avg(inputs)
inputs
AggregateOperands

Binomial

Binomial
Binomial(n, p)
n
IntRef

Number of coin flips.

p
FloatRef

Probability of a single coin flip succeeding.

Conditional

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

Defaults to constant 0.

Constant

Constant
Constant(value)
value
int

Div

Div
Div(left, right)
left
IntRef
right
IntRef

EnvironmentAttribute

EnvironmentAttribute
EnvironmentAttribute(attribute)
attribute
IntegerEnvironmentAttribute

FloorDiv

FloorDiv
FloorDiv(left, right)
left
IntRef
right
IntRef

FloorMod

FloorMod
FloorMod(left, right)
left
IntRef
right
IntRef

FromFloat

FromFloat
FromFloat(input)
input
FloatRef

Max

Max
Max(inputs)
inputs
AggregateOperands

Min

Min
Min(inputs)
inputs
AggregateOperands

Mod

Mod
Mod(left, right)
left
IntRef
right
IntRef

Mul

Mul
Mul(inputs)
inputs
AggregateOperands

Negate

Negate
Negate(input)
input
IntRef

NumberDispatcher

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

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

defaultoptional
IntRef

Defaults to constant 0.

Pow

Pow
Pow(base, exponent)
base
IntRef
exponent
IntRef

Score

Score
Score(target, score, fallback?)
target
ScoreProvider
score
string
fallbackoptional
IntRef

Defaults to constant 0.

Storage

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

Defaults to constant 0.

Sub

Sub
Sub(left, right)
left
IntRef
right
IntRef

Uniform

Uniform
Uniform(min, max)
min
IntRef
max
IntRef

WeightedList

WeightedList
WeightedList(distribution)
distribution
NonEmptyWeightedList of IntRef