World Conditions
Recipes can be restricted by world state: world name, in-game time, world difficulty, weather, dimension and moon phase. All recipe types are supported, but due to differences in implementation, some recipe types may behave in unexpected ways.
Basic Syntax
type: <recipe type>
result: '<item ID>'
# ... other recipe fields
world_conditions: # if omitted, the recipe is available in every world and state
name:
- world
- world_nether
time:
min: 13000
max: 23000
difficulty: [hard, normal]
weather: rain
environment: normal
moon_phase: [0, 1]Fields
| Field | Value | Description |
|---|---|---|
name | World name, single value or list | Uses the Bukkit world name, not a namespaced ID |
time | Number or range | In-game time from 0 to 23999. Only the time of day is used, elapsed days do not matter |
difficulty | peaceful easy normal hard, single value or list | World difficulty |
weather | clear rain thunder, single value or list | World weather. While thundering it counts as thunder only |
environment | normal nether the_end custom, single value or list | World dimension |
moon_phase | Number or range | Moon phase from 0 to 7, where 0 is a full moon |
Numbers and Ranges
time and moon_phase take numbers in two forms: a plain number means "equals", while min / max describe a range. Writing only one of them leaves the other side unbounded.
world_conditions:
time: 13000 # exactly 13000
time:
min: 13000 # greater than or equal to 13000
max: 23000 # less than or equal to 23000
time:
max: 1000 # only the upper bound is limitedA list may mix numbers and ranges, and any single match is enough. The example below allows both the night and the early morning:
world_conditions:
time:
- min: 13000
max: 23000
- max: 1000How Conditions Combine
Within one field, a list means "any of these matches". Across different fields, every field must match.
world_conditions:
name: [world, world_nether] # in world or world_nether
time: # and during the night
min: 13000
max: 23000
difficulty: hard # and on hard difficultyUpgrading from Older Versions
Older versions used enable_worlds to restrict worlds. That option has been removed. Recipe files are converted automatically on startup:
# before
enable_worlds:
- world
- world_nether
# after
world_conditions:
name:
- world
- world_nether- The conversion rewrites the recipe file, so comments in it are not kept.
- A recipe that still contains
enable_worldsafterwards is reported on load and becomes unavailable in every world.
When Conditions Are Checked
Conditions are evaluated against the current world state whenever a recipe is matched, so time, difficulty and weather changes take effect immediately without a reload.
Recipe registration itself does not change: a recipe whose conditions currently fail still appears in the recipe book, it just cannot be crafted.
Version Differences
Crafting table recipes (shaped, shapeless), smelting recipes (furnace, blast furnace, smoker, campfire), smithing recipes (transform, trim), and anvil recipes
When world conditions are configured, the recipe effectively does not exist wherever they do not match. Therefore it will not interfere with other recipes using the same crafting method, allowing the same ingredients to produce different results in different worlds.
Brewing recipes
Below 26.2, brewing recipes will still start brewing in disabled worlds but cannot produce a result.
From 26.3 onward, brewing recipes behave the same as crafting table recipes and other recipe types.
Stonecutting recipes
As a special recipe type, a stonecutting recipe is still visible and selectable in the stonecutter even if it is set to be unavailable in a world, but it cannot actually be crafted.
