
Smart Recipes
Tired of the standard Minecraft recipe format? Want to add more event-based content to the game, like in Terraria? Then the Smart Recipes mod is exactly what you need! Create unique game mechanics with the new conditional recipe format!
How the Mod Works
The Smart Recipes mod extends Minecraft's standard recipe system by adding the ability to set activation conditions. This opens up endless possibilities for creating dynamic and context-dependent recipes.
Condition Format
The mod introduces a new smart_recipes:conditions
property to the recipe format. You can use various writing styles for conditions - from detailed to maximally compact.
"smart_recipes:conditions": {
"conditionName0": [4, "2"],
"conditionName1": "foo"
}
All the format examples below are supported by the mod, so you can choose the style that suits you best.
Reload Conditions
For recipes that depend on changing parameters (weather, time of day, etc.), reload conditions are provided:
"smart_recipes:reload_conditions": [
"weather_changed",
"time_changed"
]
Available Conditions
Basic Logical Operators
false
— always returnsfalse
true
— always returnstrue
or
/any
— returnstrue
if any condition is trueand
/all
— returnstrue
if all conditions are truenot
/none
— returnstrue
if no conditions are true
Game Difficulty Conditions
is_hardcore
— Hardcore modeis_peaceful_difficulty
— Peaceful difficultyis_easy_difficulty
— Easy difficultyis_normal_difficulty
— Normal difficultyis_hard_difficulty
— Hard difficultydifficulty_check
— check by numeric or string values
Game Mode Conditions
is_survival
— Survival modeis_creative
— Creative modeis_adventure
— Adventure modeis_spectator
— Spectator modegamemode_check
— check by numeric or string values
World Environment Conditions
weather_check
— weather check (clear, rain, thunder)time_check
— time of day check (day, noon, sunset, midnight, sunrise, night)
Player and Content Conditions
players_online
— player online status checkblocks_registered
— registered blocks checkitems_registered
— registered items checkblock_entities_registered
— registered block entities checkentries_registered
— registry entries checkfabric:mods_loaded
— loaded mods check
Reload Conditions
player_joined
andplayer_disconnected
— when player connects/disconnectsdifficulty_changed
— when difficulty changesgamemode_changed
— when game mode changesweather_changed
— when weather changestime_changed
— when time of day changes
Practical Example
Let's say we want to create a simplified TNT recipe with the following conditions:
- Available only at midnight and sunrise
- Only in clear weather
- Unavailable when player Vladimir is online
- Only on hard difficulty
{
"type": "minecraft:crafting_shaped",
"pattern": [
"# X",
" ",
"X #"
],
"key": {
"#": {
"item": "minecraft:sand"
},
"X": {
"item": "minecraft:gunpowder"
}
},
"result": {
"item": "minecraft:tnt"
},
"smart_recipes:conditions": {
"time_check": ["midnight", "sunrise"],
"weather_check": "clear",
"not": {
"players_online": ["Vladimir"]
},
"difficulty_check": "hard"
},
"smart_recipes:reload_conditions": [
"time_changed",
"weather_changed",
"player_joined",
"player_disconnected",
"difficulty_changed"
]
}
System Requirements
- Minecraft version 1.17.x and above
- Fabric Loader version 0.11.3 and above
- Fabric API version 0.35.0 and above
Using as a Dependency
You can include Smart Recipes in your mod to use the conditional format without requiring players to download the mod separately.
build.gradle
:
repositories {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
content {
includeGroup "maven.modrinth"
}
}
}
dependencies {
modImplementation "maven.modrinth:smart-recipes:${project.smart_recipes_version}"
}
gradle.properties
:
smart_recipes_version=/ specify latest version here /
Building from Sources
Requirements: JDK 17
Linux/MacOS:
git clone https://github.com/Kir-Antipov/smart-recipes.git
cd smart-recipes
chmod +x ./gradlew
./gradlew build
cd build/libs
Windows:
git clone https://github.com/Kir-Antipov/smart-recipes.git
cd smart-recipes
gradlew build
cd build/libs