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 map 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
Condition Source
Condition sources are used by minecraft:condition rule sources to decide if their sub-source should be used
In scripts, they can be defined as
- A string:
- If
'above_preliminary_surface': Aminecraft:above_preliminary_surfacecondition source - If
'hole': Aminecraft:holecondition source - If
'temperature': Aminecraft:temperaturecondition source - If
'steep': Aminecraft:steepcondition source
- If
- A list: A
minecraft:biomecondition source- List elements are expected to be biome ids
- 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
'biome'field, aminecraft:biomecondition source will be created- The
biomeobject is expected to be a list whose entries are biome ids
- The
- If the map contains a
'noise_threshold'field, aminecraft:noise_thresholdcondition source will be made- The
noise_thresholdobject is expected to be a map with the following fields'noise': The id of a noise'min_threshold': Anumber, the minimum noise value where the condition passes'max_threshold': Anumber, the maximum noise value where the condition passes- Optional, defaults to
(2 - Math.power(2, -52)) * Math.power(2, 1023)
- Optional, defaults to
- The
- If the map contains a
'vertical_gradient'field, aminecraft:vertical_gradientcondition source will be created- The
vertical_gradientobject is expected to be a map with the following fields'random_name': A string'true_at_and_below': A vertical anchor, the condition will always pass at and below this height'false_at_and_above': A vertical anchor, the condition will always pass at and above this height
- The
- If the map contains a
'y_above'field, aminecraft:y_abovecondition source will be created- The
y_aboveobject is expected to be a map with the following fields'add_stone_depth': Aboolean, If the distance to the surface above should be added- Optional, defaults to
false
- Optional, defaults to
'anchor': A vertical anchor, the anchor to compare the height to'surface_depth_multiplier': Aint, how much the comparison is affected by the surface depth- Must be in the range
[-20, 20]
- Must be in the range
- The
- If the map contains a
'water'field, aminecraft:watercondition source will be created- The
waterfield is expected to be a map with the following fields'offset': Anint, the value added to the water depth before comparison'surface_depth_multiplier': Anint, how much the comparison is affected by the surface depth- Must be in the range
[-20, 20]
- Must be in the range
'add_stone_depth': Aboolean, if the distance to the surface should be added to the offset- Optional, defaults to
false
- Optional, defaults to
- The
- If the map contains a
'temperature'field, aminecraft:temperaturecondition source will be created - If the map contains a
'steep'field, aminecraft:steepcondition source will be created - If the map contains a
'not'field, aminecraft:notcondition source will be created- The
notfield is expected to be a condition source, the condition source to invert
- The
- If the map contains a
'hole'field, aminecraft:holecondition source will be created - If the map contains a
'above_preliminary_surface'field, aminecraft:above_preliminary_surfacecondition surface will be created - If the map contains a
'stone_depth'field, aminecraft:stone_depthcondition source will be created- The
stone_depthobject is expected to be a map with the following fields'offset': Anint, the vertical offset'add_surface_depth': Aboolean, if the surface depth should be added to the offset- Optional, defaults to
false
- Optional, defaults to
'secondary_depth_range': Anint, the mapped value of the secondary surface depth to add to the offset'surface_type': ACaveSurface, the surface type to compare toReveal/hide valid cave surfaces
floorceiling
- The
- If the map contains a
Other values will emit an error
Density Function
Density functions define a function to obtain a number from a position
In scripts they can de defined as
- A
DensityFunctionobject: itself - A string,
ResourceLocation, or density functionResourceKey: The density function previously registered under the given id - A
number: Aminecraft:constantdensity function- Must be in the range
[-1000000, 1000000]
- Must be in the range
- 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
'blend_alpha'field, aminecraft:blend_alphadensity function will be created - If the map contains a
'beardifier'field, aminecraft:beardifierdensity function will be created - If the map contains a
'old_blend_noise'field, aminecraft:old_blend_noisedensity function will be created- The
old_blend_noiseobject is expected to be a map with the following fields'xz_scale': Anumber, the horizontal scale- Must be in the range
[0.001, 1000]
- Must be in the range
'y_scale': Anumber, the vertical scale- Must be in the range
[0.001, 1000]
- Must be in the range
'xz_factor': Anumber, the horizontal scale- Must be in the range
[0.001, 1000]
- Must be in the range
'y_factor': Anumber, the vertical scale- Must be in the range
[0.001, 1000]
- Must be in the range
'smear_scale_multiplier': Anumber, a multiplier applied to they_scale- Must be in the range
[1, 8]
- Must be in the range
- The
- If the map contains a
'interpolated'field, aminecraft:interpolateddensity function will be created- The
interpolatedobject is expected to be a density function
- The
- If the map contains a
'flat_cache'field, aminecraft:flat_cachedensity function will be created- The
flat_cacheobject is expected to be a density function
- The
- If the map contains a
'cache_2d'field, aminecraft:cache_2ddensity function will be created- The
cache_2dobject is expected to be a density function
- The
- If the map contains a
'cache_once'field, aminecraft:cache_oncedensity function will be created- The
cache_onceobject is expected to be a density function
- The
- If the map contains a
'cache_all_in_cell'field, aminecraft:cache_all_in_celldensity function will be made- The
cache_all_in_cellobject is expected to be a density function
- The
- If the map contains a
'noise'field, aminecraft:noisedensity function will be created- The
noiseobject is expected to be a map with the following fields'noise': A noise parameters id, the noise to use'xz_scale': Anumber, the horizontal scaling before sampling'y_scale': Anumber, the vertical scaling before sampling
- The
- If the map contains a
'end_islands'object, aminecraft:end_islandsdensity function will be made - If the map contains a
'weird_scaled_sampler'field, aminecraft:weird_scaled_samplerdensity function will be created- The
weird_scaled_sampleris expected to be a map with the following fields'input': A density function, the function to be scaled'noise': A noise parameters id, the noise to use'rarity_value_mapper': ARarityValueMapper, the value mapper type to useReveal/hide valid rarity value mappers
type1type2
- The
- If the map contains a
'shifted_noise'field, aminecraft:shifted_noisedensity function will be created- The
shifted_noiseobject is expected to be map with the following fields'shift_x': A density function, the shift in the x direction'shift_y': A density function, the shift in the y direction'shift_z': A density function, the shift in the z direction'xz_scale': Anumber, the horizontal scaling before sampling'y_scale': Anumber, the vertical scaling before sampling'noise': A noise parameters id, the noise to use
- The
- If the map contains a
'range_choice'field, aminecraft:range_choicedensity function will be created- The
range_choiceobject is expected to be a map with the following fields'input': A density function, the value to compare'min_inclusive': Anumber, the lower bound of the range- Must be in the range
[-1000000, 1000000]
- Must be in the range
'max_inclusive': Anumber, the upper bound of the range- Must be in the range
[-1000000, 1000000]
- Must be in the range
'when_in_range': A density function, the value to use when theinputis within the range'when_out_of_range': A density function, the value to use when theinputis outside of the range
- The
- If the map contains a
'shift_a'field, aminecraft:shift_adensity function will be created- The
shift_aobject is expected to be a noise parameters id, the noise to sample
- The
- If the map contains a
'shift_b'field, aminecraft:shift_bdensity function will be created- The
shift_bobject is expected to be a noise parameters id, the noise to sample
- The
- If the map contains a
'shift'field, aminecraft:shiftdensity function will be created- The
shiftfield is expected to be a noise parameters id, the noise to sample
- The
- If the map contains a
'blend_density'field, aminecraft:blend_densitydensity function will be created- The
blend_densityobject is expected to be a density function, the desired density of new chunks
- The
- If the map contains a
'clamp'field, aminecraft:clampdensity function will be created- The
clampobject is expected to be a map with the following fields'input': A density function, the function be clamped'min_value': Anumber, the minimum value- Must be in the range
[-1000000, 1000000]
- Must be in the range
'max_value': Anumber, the maximum value- Must be in the range
[-1000000, 1000000]
- Must be in the range
- The
- If the map contains an
'abs'field, aminecraft:absdensity function will be created- The
absobject is expected to be a density function, the function to be absolute valued
- The
- If the map contains a
'square'field, aminecraft:squaredensity function will be created- The
squareobject is expected to be a density function, the function to be squared
- The
- If the map contains a
'cube'field, aminecraft:cubedensity function will be created- The
cubeobject is expected to be a density function, the function to be cubed
- The
- If the map contains a
'half_negative'field, aminecraft:half_negativedensity function will be created- The
half_negativeobject is expected to be a density function, the function to halve when negative
- The
- If the map contains a
'quarter_negative'field, aminecraft:quarter_negativedensity function will be created- The
quarter_negativefield is expected to be a density function, the function to be quartered when negative
- The
- If the map contains a
'squeeze'field, aminecraft:squeezedensity function will be created- The
squeezeobject is expected to be a density function, the function to be squeezed
- The
- If the map contains an
'add'field, aminecraft:adddensity function will be created- The
addobject is expected to be a map with two fields'first': A density function'second': A density function
- The
- If the map contains a
'mul'field, aminecraft:muldensity function will be created- The
mulobject is expected to be a map with two fields'first': A density function'second': A density function
- The
- If the map contains a
'min'field, aminecraft:mindensity function will be created- The
minobject is expected to be a map with two fields'first': A density function'second': A density function
- The
- If the map contains a
'max'field, aminecraft:maxdensity function will be created- The
maxobject is expected to be a map with two fields'first': A density function'second': A density function
- The
- If the map contains a
'spline'field, aminecraft:splinedensity function will be created- The
splineobject is expected to be a spline
- The
- If the map contains a
'constant'field, aminecraft:constantdensity function will be created- The
constantfield is expected to be Anumber, the constant value- Must be in the range
[-1000000, 1000000]
- Must be in the range
- The
- If the map contains a
'y_clamped_gradient'field, aminecraft:y_clamped_gradientdensity function will be created- The
y_clamped_gradientobject is expected to be a map with the following fields'from_y': Anint, the value to map tofrom_value- Must be in the range
[-4064, 4062]
- Must be in the range
'to_y': Anint, the value to map toto_value- Must be in the range
[-4064, 4062]
- Must be in the range
'from_value': Anumber, the value to mapfrom_yto- Must be in the range
[-1000000, 1000000]
- Must be in the range
'to_value': Anumber, the value to mapto_yto- Must be in the range
[-1000000, 1000000]
- Must be in the range
- The
- If the map contains a
Other values will emit an error
Spline
In density functions, splines can be defined in scripts as
- A
number: A constant value - A map with the following fields
'coordiante': A string,ResourceLocation, or density functionResourceKey: The previously registered density function used to determine the location on the spline'value_transformer': The transformer applied to constant spline points. A callback with the paramsvalue: number: The value of the pointreturn: number: The transformedvalue- Optional, defaults to
val => val
'points': A list of spline points, which are maps with the following fields- For a constant point
'location': Anumber, the location of the point on the spline'value': Anumber, the value of the point'derivative': Anumber, the slope at the point
- For a variable point
'location': Anumber, the location of the point on the spline'value': A spline, the value of the point
- For a constant point
Other values will emit an error
Height Provider
Height providers specify a height (range) to select from when generating certain features
In scripts, they can be defined as
- A
HeightProviderobject: itself - A
number: Aminecraft: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
- Optional, defaults to
'extreme': Aboolean, 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
Rule Source
Rule sources determine the block for each solid position of the terrain
In scripts, they can be defined as
- A
RuleSourceobject: itself - The string
'badlands': aminecraft:badlandsrule source - A list: A
minecraft:sequencerule source- List values will be parsed as rule sources, the rules for the sequence
- 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
'badlands'field, aminecraft:badlandsrule source - If the map contains a
'sequence'field, aminecraft:sequencerule source will be created- The
sequenceobject is expected to a list- The list entries will be parsed as rule sources, the rules of the sequence
- The
- If the map contains a
'block'field, aminecraft:blockrule source will be created- The
blockobject is expected to be a block state
- The
- If the map contains a
'condition'field, aminecraft:conditionrule source will be created- The
conditionobject is expected to be a map with the following fields'if_true': A condition source'then_run': A rule source
- The
- If the map contains a
- A block state, or anything which can parse as one: A
minecraft:blockrule source placing that block state is placed
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
VerticalAnchorobject: itself - A
number: Anabsoluteanchor 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 used to describe arbitrary weighted collections in a manner that is script-friendly. They 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 object 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