Skip to content

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 ​

yaml
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 ​

FieldValueDescription
nameWorld name, single value or listUses the Bukkit world name, not a namespaced ID
timeNumber or rangeIn-game time from 0 to 23999. Only the time of day is used, elapsed days do not matter
difficultypeaceful easy normal hard, single value or listWorld difficulty
weatherclear rain thunder, single value or listWorld weather. While thundering it counts as thunder only
environmentnormal nether the_end custom, single value or listWorld dimension
moon_phaseNumber or rangeMoon 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.

yaml
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 limited

A list may mix numbers and ranges, and any single match is enough. The example below allows both the night and the early morning:

yaml
world_conditions:
  time:
    - min: 13000
      max: 23000
    - max: 1000

How Conditions Combine ​

Within one field, a list means "any of these matches". Across different fields, every field must match.

yaml
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 difficulty

Upgrading from Older Versions ​

Older versions used enable_worlds to restrict worlds. That option has been removed. Recipe files are converted automatically on startup:

yaml
# 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_worlds afterwards 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.

基于 MIT 许可证发布