Download Smart Recipes — Minecraft Mods — MetaMods

Smart Recipes

Active

Downloads

0

Last update

1 year ago

Versions

1.17 — 1.20.4
Server
Fabric
Libraries
Utils

Smart Recipes

Logo

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 returns false
  • true — always returns true
  • or/any — returns true if any condition is true
  • and/all — returns true if all conditions are true
  • not/none — returns true if no conditions are true

Game Difficulty Conditions

  • is_hardcore — Hardcore mode
  • is_peaceful_difficulty — Peaceful difficulty
  • is_easy_difficulty — Easy difficulty
  • is_normal_difficulty — Normal difficulty
  • is_hard_difficulty — Hard difficulty
  • difficulty_check — check by numeric or string values

Game Mode Conditions

  • is_survival — Survival mode
  • is_creative — Creative mode
  • is_adventure — Adventure mode
  • is_spectator — Spectator mode
  • gamemode_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 check
  • blocks_registered — registered blocks check
  • items_registered — registered items check
  • block_entities_registered — registered block entities check
  • entries_registered — registry entries check
  • fabric:mods_loaded — loaded mods check

Reload Conditions

  • player_joined and player_disconnected — when player connects/disconnects
  • difficulty_changed — when difficulty changes
  • gamemode_changed — when game mode changes
  • weather_changed — when weather changes
  • time_changed — when time of day changes

Practical Example

Let's say we want to create a simplified TNT recipe with the following conditions:

  1. Available only at midnight and sunrise
  2. Only in clear weather
  3. Unavailable when player Vladimir is online
  4. 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
Project members
Kir_Antipov

Kir_Antipov

Developer

Kira-NT

Kira-NT

Developer

Kira_NT

Kira_NT

Created: 5 Sep 2021

ID: 4910