Recipe Options - mehboss/CustomRecipes GitHub Wiki

This is NOT implemented publically yet and is currently included in beta v2.0.4.7 and beyond.

Recipe Conditions

This guide explains how to configure conditions for recipes in your plugin.
Conditions allow you to restrict when and where a recipe can be crafted.


Types of Condition Blocks

There are two types of blocks you can use:

conditions (or conditions_all)

  • All rules must pass together for the recipe to work.
  • Within each rule, if you provide multiple options, it’s treated as OR.
    (Example: world: [world, world_nether] means either world is valid.)

conditions_any

  • This is an OR block: if you define multiple condition sets under conditions_any, only one of them needs to pass.
  • Think of it like: “at least one of these condition sets must succeed.”

Available Condition Keys

1. World

Restrict the recipe to certain worlds.

world: ["world", "world_nether"]

Deny specific worlds:

world_deny: ["world_the_end"]

2. Biome

Restrict the recipe to certain biomes.

biome: ["plains", "forest"]

Deny specific biomes:

biome_deny: ["desert"]

3. Time

Restrict crafting to certain times of day.
Time is measured in Minecraft ticks (0–23999).

  • 0 = sunrise
  • 6000 = noon
  • 13000 = sunset
  • 18000 = midnight

You can use ranges, and even multiple ranges:

time: ["13000-23000", "0-2000"]

4. Weather

Restrict crafting based on weather. Options:

  • clear
  • rain
  • thunder

Example:

weather: ["clear", "rain"]

5. Moon Phase

Restrict crafting based on the current moon phase.
Minecraft has 8 phases, from 0–7:

  • 0 = full_moon
  • 1 = waning_gibbous
  • 2 = last_quarter
  • 3 = waning_crescent
  • 4 = new_moon
  • 5 = waxing_crescent
  • 6 = first_quarter
  • 7 = waxing_gibbous

Example:

moon_phase: [0, 4]

6. Advancements

Require the player to have completed one or more advancements.
If the recipe is used by an automated crafter block, this is skipped.

Example:

advancement: ["story/mine_stone", "story/iron_tools"]

Example: All Conditions Together

conditions:
  world: ["world", "world_nether"]
  biome: ["plains", "forest"]
  time: ["13000-23000", "0-2000"]
  weather: ["clear", "rain"]
  moon_phase: ["full_moon"]
  advancement: ["story/mine_stone"]

Example: Any Conditions (OR logic)

conditions_any:
  - world: ["world"]
    time: ["0-2000"]
  - world: ["world_nether"]
    weather: ["thunder"]

This means:

  • Either it’s between 0–2000 ticks in world,
  • OR it’s thundering in world_nether.

Recipe Leftover Items

This guide explains how to configure ItemsLeftover for recipes.
Leftover items are what remain in the crafting grid after a recipe is crafted.


ItemsLeftover

Use the ItemsLeftover section to define which items should remain after crafting.
This is useful for cases like buckets, bottles, or custom ingredients that shouldn’t disappear.

Key Points:

  • Can be a Minecraft material name (e.g., BUCKET, GLASS_BOTTLE, EMERALD).
  • Can be a custom ingredient identifier (if you define your own system).
  • Use [] if no leftovers are needed.
  • Supports multiple items.

Example: With One Leftover Item

ItemsLeftover:
  - EMERALD

When the recipe is crafted, an emerald will remain in the crafting grid.


Example: With Custom Items

ItemsLeftover:
  - itemsadder:custom_item
  - cursed_sword

Both the itemsadder item custom_item and the custom recipe cursed_sword will remain.


Example: No Leftovers

ItemsLeftover: []