Type Wrappers
Block Predicate
Block predicates test for a block state at a position within the world
In scripts, they can de defined as
- A
BlockPredicateobject: itself - A
Blockobject: Aminecraft:matching_blockspredicate matching the given block - A
Fluidobject: Aminecraft:matching_fluidspredicate matching the given fluid - A
TagKeyobject: Aminecraft:matching_block_tagpredicate matching the given tag - A string:
- If starts with a
#character: Aminecraft:matching_block_tagpredicate matching the given tag id - Else: A
minecraft:matching_blockspredicate matching the given block id
- If starts with a
- A list: A
minecraft:all_ofpredicate- List values are expected to be block predicates (or capable of being wrapped as block predicates) themselves
- A
booleanobject:- If
true: Aminecraft:truepredicate - If
false: Aminecraft:notpredicate wrapping aminecraft:truepredicate
- If
- A map:
- If the map contains a
'type'field, the map is parsed as if it were defined in json, using the specification linked above - If the map contains a
'not'field, aminecraft:notpredicate will be made- The
notobject is expected to be a block predicate or capable of being wrapped as a block predicate
- The
- If the map contains an
'all'field, aminecraft:all_ofpredicate will be made- The
allobject is expected to be a list whose values are block predicates themselves (or are capable of being wrapped as block predicates) themselves
- The
- If the map contains an
'any'field, aminecraft:any_ofpredicate will be made- The
anyobject is expected to be a list whose values are block predicates themselves (or are capable of being wrapped as block predicates) themselves
- The
- If the map contains a
'blocks'field, aminecraft:matching_blockspredicate is made- The
blocksobject is expected to be a map with the following fields'offest': AVec3i, the offset applied to the check when validating a checked position- Optional, defaults to
[0, 0, 0]
- Optional, defaults to
'match': A blockHolderSet, the valid blocks- Most commonly a list of block ids, or a
#-prefixed tag id
- Most commonly a list of block ids, or a
- The
- If the map contains a
'tag'field, aminecraft:matching_block_tagpredicate is made- The
tagobject is expected to be a map with the following fields'offest': AVec3i, the offset applied to the check when validating a checked position- Optional, defaults to
[0, 0, 0]
- Optional, defaults to
'match': A blockTagKey, the valid blocks- Can be defined as a string, the id of the tag
- The
- If the map contains a
'fluids'field, aminecraft:matching_fluidspredicate is made- The
fluidsobject is expected to be a map with the following fields'offest': AVec3i, the offset applied to the check when validating a checked position- Optional, defaults to
[0, 0, 0]
- Optional, defaults to
'match': A fluidHolderSet, the valid fluids- Most commonly a list of fluid ids, or a
#-prefixed tag id
- Most commonly a list of fluid ids, or a
- The
- If the map contains a
'replaceable'field, aminecraft:replaceablepredicate is made- The
replaceableobject is expected to be a map with the following field'offest': AVec3i, the offset applied to the check when validating a checked position- Optional, defaults to
[0, 0, 0]
- Optional, defaults to
- The
- If the map contains a
'would_survive'field, aminecraft:would_survivepredicate is made- The
would_surviveobject is expected to be a map with the following fields'offest': AVec3i, the offset applied to the check when validating a checked position- Optional, defaults to
[0, 0, 0]
- Optional, defaults to
'state': A block state, the state survivability is being checked with
- The
- If the map contains a
'has_sturdy_face'field, aminecraft:has_sturdy_facepredicate is made- The
has_sturdy_faceobject is expected to be an object with the following fields'offest': AVec3i, the offset applied to the check when validating a checked position- Optional, defaults to
[0, 0, 0]
- Optional, defaults to
'direction': ADirection, the direction to check if a block is sturdyReveal/hide list of allowed directions
updowneastwestnorthsouth
- The
- If the map contains a
'solid'field, aminecraft:solidpredicate is made- The
solidobject is expected to be a map with the following field'offest': AVec3i, the offset applied to the check when validating a checked position- Optional, defaults to
[0, 0, 0]
- Optional, defaults to
- The
- If the map contains a
'no_fluid'field, aminecraft:matching_fluidspredicate which only matchesminecraft:emptyis made- The
no_fluidobject is expected to be a map with the following field'offest': AVec3i, the offset applied to the check when validating a checked position- Optional, defaults to
[0, 0, 0]
- Optional, defaults to
- The
- If the map contains a
'inside_world'field, aminecraft:inside_world_boundsis made- The
inside_worldobject is expected to be a map with the following field'offest': AVec3i, the offset applied to the check when validating a checked position- Optional, defaults to
[0, 0, 0]
- Optional, defaults to
- The
- If the map contains an
'unobstructed'field, aminecraft:unobstructedpredicate is made- The
unobstructedobject is expected to be a map with the following field'offest': AVec3i, the offset applied to the check when validating a checked position- Optional, defaults to
[0, 0, 0]
- Optional, defaults to
- The
- If the map contains a
Other values will emit an error
Block State Provider
Block state providers specify a block(state) which may be randomized
In scripts, they can be defined as
- A
BlockStateProviderobject: itself - A
Blockobject: Aminecraft:simple_state_providerproviding the given block - A
BlockStateobject: Aminecraft:simple_state_providerproviding the given block state - A list: A
minecraft:weighted_state_providerprovider- List values are expected to be block state provider weighted values
- A map:
- If the map contains a
'type'field, the map is parsed as if it were defined in json, using the specification linked above - If the map contains a
'simple'or'block'field, aminecraft:simple_state_providerprovider will be made- The
simple/blockobject is expected to be a block state or capable of being wrapped as a block state
- The
- If the map contains a
'rotate'field, aminecraft:rotated_block_providerwill be created- The
rotateobject is expected to be a block or capable of being wrapped as a block
- The
- If the map contains a
'randomized_int'field, aminecraft:randomized_int_state_providerprovider will be created- The
randomized_intobject is expected to be a map with the following fields'property': A string, the name of the block property'values': AnIntProvider, the possible values of the block property'source': ABlockStateProvider, the source state to apply the property value to
- The
- If the contains a
'weighted'field, aminecraft:weighted_state_providerprovider will be made- The
weightedobject is expected to be a list of block state provider weighted values
- The
- If the map contains a
Other values will be attempted to be parsed as a BlockState and if successful, a minecraft:simple_state_provider will be made, else an error will be emitted
Height Provider
Height providers specify a height (range) to select from when generating certain features
In scripts, they can be defined as
- A single number: A
minecraft:constantheight provider with anabsolutevertical anchor of the given y-level - A map:
- If the map contains a
'type'field, the map is parsed as if it were defined in json, using the specification linked above - If the map contains a
'uniform'field, aminecraft:uniformheight provider will be created- The
uniformobject is expected to be a map with two fields'min': A vertical anchor, the minimum height'max': A vertical anchor, the maximum height
- The
- If the map contains a
'constant'field, aminecraft:constantheight provider will be created- The
constantobject will be parsed as a [[ vertical anchor ]], the height
- The
- If the map contains a
'trapezoid'field, aminecraft:trapezoidheight provider will be created- The
trapezoidobject is expected to be a map with the following fields'min': A vertical anchor, the minimum height'max': A vertical anchor, the maximum height'plateau': Anint, the range in the middle of the trapezoid distribution that has a uniform distribution- Optional, defaults to
0
- Optional, defaults to
- The
- If the map contains a
'weighted'field, aminecraft:weighted_listheight provider will be created- The
weightedobject is expected to a list of height provider weighted values
- The
- If the map contains a
'biased'field, aminecraft:biased_to_bottomheight provider will be created- The
biasedobject is expected to be a map with the following fields'min': A vertical anchor, the minimum height'max': A vertical anchor, the maximum height'inner': Anint, the inner value- Optional, defaults to
1 'extreme': Aboolean{.p}, if the height provider should instead be aminecraft:very_biased_to_bottomheight provider- Optional, defaults to
false
- Optional, defaults to
- The
- If the map contains a
- A list: A
minecraft:weighted_listheight provider- List values are expected to be height provider weighted values
- A
HeightProviderobject: itself - A
VerticalAnchorobject: aminecraft:constantheight provider at the given vertical anchor
Other values will emit an error
Vertical Anchor
Vertical anchors specify a y-value for feature generation, often as part of height providers
In scripts, they can be defined as
- A single number: An
absoluteanchor at the given y-level - A string:
- If
'bottom': Anabove_bottomanchor with a value of0 - If
'top': Abelow_topanchor with a value of0 - If
'-'or'zero': Anabsoluteanchor with a value of0
- If
- A map:
- If the map contains a
'type'field, the map is parsed as if it were defined in json, using the specification linked above - If the map contains an
'absolute'field, anabsoluteanchor is created- The
absoluteobject will be parsed as a number to use as the value of the anchor
- The
- If the map contains a
'above_bottom'field, aabove_bottomanchor is created- The
above_bottomobject will be parsed as a number to use as the value of the anchor
- The
- if the map contains a
'below_top'field, abelow_topanchor is created- The
below_topobject will be parsed as a number to use as the value of the anchor
- The
- If the map contains a
- A
VerticalAnchorobject: itself
Other values will emit an error
Weighted Value
Weighted values are ways of describing a collection of objects which can be weighted. Weighted values are always made as part of a list which will never accept null or undefined values. Weights less than 1 are also considered invalid and will emit an exception if encountered
Weighted values for a type can be created as
- A
WeightedValueobject: Will attempt to convert the value object of the given weighted value to expected type and emit a weighted value with the same weight- Will emit an error if the value could not be converted to the expected type
- A map with
'weight'and'value'fields:'weight': The weight given to thevalue, anintthat must be greater than0'value': The value the is being weighted, an object of the expected type or any of its wrapped forms
- A list:
- The first item will be interpreted as an
int, the weight - The second item will be wrapped to an object of the expected type or any of its wrapped forms
- The first item will be interpreted as an
- An object of the expected type or any of its wrapped forms
- Will have a weight of
1
- Will have a weight of