Skip to content

Criterion

gniftygnome edited this page Jun 24, 2024 · 6 revisions

Using Criteria

The purpose of criteria is to specify the conditions under which a biome should be replaced by a sub-biome. There are several different kinds of criteria, and several different targets for the criteria to match against. Some criteria are containers for other criteria. All criteria except the not criterion return true when they match.

Container Criteria

  • not: Contains one Criterion and inverts its match
  • all_of: Contains a list of type Criterion, all of which must match
  • any_of: Contains a list of type Criterion, at least one of which must match

Biome Criteria

  • original: Matches the specified biome or tag against the originally selected noise biome before replacement by Biolith
  • neighbor: Matches the specified biome or tag against next-closest biome found during noise selection
  • alternate: Matches the specified biome or tag against the replacement biome that would have been selected, if the noise biome selected had been different

Numerical Criteria

All numerical criteria can be specified with only their lower or upper boundary; the other boundary will be effectively ignored.

  • value: Matches when the specified raw noise value being evaluated is within the provided range
  • deviation: Matches when the distance from the center of the selected biome's parameter range to to a selected noise value is within the provided range
  • ratio: Checks whether a computed ratio of the distance to the target's center or edge is within the provided range

in code

  • Criterion factories by type:
type factories target specifiers
container allOf, anyOf, not
biome alternate, original, neighbor
deviation deviation, deviationMin, deviationMax BiomeParameterTargets:
CONTINENTALNESS
DEPTH
EROSION
HUMIDITY
PEAKS_VALLEYS
TEMPERATURE
WEIRDNESS
ratio ratio, ratioMin, ratioMax RatioTargets:
CENTER
EDGE
value value, valueMin, valueMax BiomeParameterTargets:
CONTINENTALNESS
DEPTH
EROSION
HUMIDITY
PEAKS_VALLEYS
TEMPERATURE
WEIRDNESS
// A criterion to place a sub-biome near the noise center of a biome.
CriterionBuilder.ratioMax(
        RatioTargets.CENTER,
        0.2f);

// A criterion for lining up a modded midlands biome with its associated modded highlands biome.
CriterionBuilder.alternate(
        ModBiomeKeys.MOD_HIGHLANDS,
        BiomeKeys.END_HIGHLANDS);

// A criterion for using the peaks and valleys noise to add clearings to a forest.
CriterionBuilder.deviationMin(
        BiomeParameterTargets.PEAKS_VALLEYS,
        0.05d);

as data

  • A criterion to place a sub-biome near the noise center of a biome.
"criterion": {
  "type": "biolith:ratio",
  "target": "center",
  "max": 0.2
}
  • A criterion for lining up a modded midlands biome with its associated modded highlands biome.
"criterion": {
  "type": "biolith:alternate",
  "biome": "mymod:my_highlands",
  "secondary": "minecraft:end_highlands"
}
  • A criterion for using the peaks and valleys noise to add clearings to a forest.
"criterion": {
  "type": "biolith:deviation",
  "target": "peaks_valleys",
  "min": 0.05
}
Clone this wiki locally