Skip to content

Lychee

Generated page, edit scripts/gen_schema_pages.py instead.

Lychee recipes (1.20.1), pkl4mc dialect.

Lychee is a generic rule engine, not a fixed recipe list: every recipe pairs a typed trigger (below) with an open-ended post action DSL (drop_item, place, damage_item, prevent_default, random, if, …) and an equally open contextual condition DSL (chance, location, and/or/not, …). Typing that whole action/condition language is out of scope for this pass, post/contextual are raw passthrough here: write real Lychee JSON for them directly (see the mod’s own docs), same escape-hatch pattern as generic_recipes.pkl. Everything else (the actual recipe triggers/ingredients) is typed.

BlockIn only supports the two shorthand forms (single block id, or a tag) plus simple exact-value state properties, the full vanilla BlockPredicate object (block lists, nbt, ranged/alternative state matchers) is not yet covered.

Usage

amends "@pkl4mc/lychee_recipes.pkl"

Example

recipes
// Lychee recipes - one example per trigger type.
// Each entry becomes `<name>.json` under this file's directory.
// `post`/`contextual` are raw passthrough - see the module doc comment in lychee_recipes.pkl.
amends "@pkl4mc/lychee_recipes.pkl"

item_burning {
  new {
    name = "example_item_burning_charcoal"
    itemIn { tag = "lychee:logs_that_burn" }
    post { type = "drop_item"; item = "minecraft:charcoal" }
  }
}

item_inside {
  new {
    name = "example_item_inside_water_bucket"
    itemIn { new { item = "minecraft:bucket" } }
    blockIn { block = "minecraft:water_cauldron"; state { ["level"] = "3" } }
    post {
      new { type = "drop_item"; item = "minecraft:water_bucket" }
      new { type = "place"; block = "minecraft:cauldron" }
    }
  }
}

block_interacting {
  new {
    name = "example_block_interacting_strip_log_diamond"
    itemIn { item = "minecraft:iron_axe" }
    blockIn { block = "minecraft:oak_log" }
    post {
      new { type = "drop_item"; item = "minecraft:diamond"; contextual { type = "chance"; chance = 0.5 } }
      new { type = "place"; block = "minecraft:stripped_oak_log" }
      new { type = "damage_item" }
    }
  }
}

block_clicking {
  new {
    name = "example_block_clicking_light_candle"
    itemIn { item = "minecraft:flint_and_steel" }
    blockIn { block = "minecraft:candle" }
    post { type = "cycle_state_property"; property = "lit" }
  }
}

anvil_crafting {
  new {
    name = "example_anvil_crafting_golden_apple"
    left { item = "minecraft:apple" }
    right { item = "minecraft:gold_ingot"; count = 8 }
    output { item = "minecraft:golden_apple" }
    levelCost = 1
    materialCost = 8
    post { type = "prevent_default" }
  }
}

block_crushing {
  new {
    name = "example_block_crushing_paper"
    itemIn {
      new { item = "minecraft:sugar_cane" }
      new { item = "minecraft:sugar_cane" }
      new { item = "minecraft:sugar_cane" }
    }
    post { type = "drop_item"; item = "minecraft:paper"; count = 3 }
  }
}

lightning_channeling {
  new {
    name = "example_lightning_channeling_charged_creeper_fuel"
    itemIn { new { item = "minecraft:gunpowder" } }
    post { type = "drop_item"; item = "minecraft:blaze_powder" }
  }
}

item_exploding {
  new {
    name = "example_item_exploding_iron_nugget"
    itemIn { new { item = "minecraft:iron_ingot" } }
    post { type = "drop_item"; item = "minecraft:iron_nugget"; count = 9 }
  }
}

block_exploding {
  new {
    name = "example_block_exploding_no_drops_bedrock"
    blockIn { block = "minecraft:bedrock" }
    post { type = "prevent_default" }
  }
}

random_block_ticking {
  new {
    name = "example_random_block_ticking_mossify"
    blockIn { block = "minecraft:stone_bricks" }
    post { type = "place"; block = "minecraft:mossy_stone_bricks" }
  }
}

dripstone_dripping {
  new {
    name = "example_dripstone_dripping_lava_obsidian"
    sourceBlock { block = "minecraft:lava" }
    targetBlock { block = "minecraft:water" }
    post { type = "place"; block = "minecraft:obsidian" }
  }
}

crafting {
  new {
    name = "example_crafting_logged_message"
    key { ["S"] { item = "minecraft:stick" } }
    pattern { "S" }
    output { item = "minecraft:bowl" }
    post { type = "execute"; command = "say a bowl was crafted" }
  }
}