Skip to content

Recipe Condition Reference ​

MBD2 21.1.1

Conditions are checked during matching and while a recipe works. All values describe the machine/controller position or runtime machine unless noted otherwise.

Built-in conditions ​

Registry nameParametersKubeJS methodTest
dimensiondimension IDdimension(id)Current level dimension equals ID
biomebiome IDbiome(id)Biome at machine position equals ID
pos_ymin, maxpositionY(min, max)Controller Y is inside inclusive range
day_timeisDaydayTime(boolean)Level day/night state matches
rainmin, maxraining(min, max)Rain level is inside range
thundermin, maxthundering(min, max)Thunder level is inside range
lightsky min/max, block min/max, can-see-skylight(...)Light channels and sky visibility match
redstone_signalmin, max (0..15)redstoneSignal(min, max)Best neighboring signal is inside range
blockmin count, max count, candidate blocksblocksInStructure(...)Formed structure contains a matching count
machine_levelminimum levelmachineLevel(level)Machine level satisfies requirement
machine_custom_datacompound, custom-data-only flagmachineData(tag, flag)Required NBT is contained in custom or full machine data

Ranges are inclusive. machine_custom_data performs a containment-style check by merging the required compound into a copy and comparing it with the source data.

Optional conditions ​

Registry nameDependencyKubeJS methodTest
create_rotationCreaterotationCondition(minRPM, maxRPM, minStress, maxStress)Available/working rotation values are within ranges
mekanism_heatMekanismmekTemperatureCondition(min, max)Mekanism temperature is within range
pneumatic_temperaturePneumaticCraftpncTemperatureCondition(min, max)Pneumatic heat-exchanger temperature is within range
pneumatic_pressurePneumaticCraftpncPressureCondition(isAir, min, max)Selected air amount or pressure is within range
ars_source_nearbyArs NouveauarsSourceNearbyCondition(radius, min, max)Source held by jars within radius is inside the range

A condition method for a mod that is not loaded throws when the script runs, so guard it in a pack where the mod is optional.

OR, AND, and reverse ​

The default RecipeCondition#isOr() returns true. MBD2 groups conditions by registered type: alternatives of the same type use OR; groups of different types use AND. reverse negates each individual test before grouping.

java
builder.addCondition(new BiomeCondition(PLAINS));
builder.addCondition(new BiomeCondition(DESERT)); // plains OR desert
builder.addCondition(new PositionYCondition(0, 64)); // AND Y 0..64

In the editor, enable a condition's reverse field for “must not match.” In Java, call .setReverse(true). A custom condition should not invert its own test result.

Released under the MIT License.