Custom crafting and smelting recipes

Recipe

Register custom crafting and smelting recipes. All methods are static — no need to instantiate.


Methods

shaped

await Recipe.shaped(key, result, shape, ingredients, amount=1)

Register a shaped crafting recipe.

# Diamond sword from sticks and emeralds
await Recipe.shaped("emerald_sword", Material.DIAMOND_SWORD, [
    "E",
    "E",
    "S"
], {
    "E": Material.EMERALD,
    "S": Material.STICK
})
# 4 TNT from sand and gunpowder
await Recipe.shaped("easy_tnt", "TNT", [
    "SG",
    "GS"
], {
    "S": "SAND",
    "G": "GUNPOWDER"
}, amount=4)

shapeless

await Recipe.shapeless(key, result, ingredients, amount=1)

Register a shapeless crafting recipe (ingredients can go in any slot).

# Combine 4 diamonds into an emerald
await Recipe.shapeless("diamond_to_emerald", Material.EMERALD, [
    Material.DIAMOND, Material.DIAMOND,
    Material.DIAMOND, Material.DIAMOND
])

furnace

await Recipe.furnace(key, input, result, experience=0, cook_time=200, amount=1)

Register a furnace smelting recipe.

# Smelt gravel into flint
await Recipe.furnace("gravel_to_flint", Material.GRAVEL, Material.FLINT, experience=0.1)

# Fast-cook cobblestone into stone (5 seconds)
await Recipe.furnace("fast_stone", "COBBLESTONE", "STONE", cook_time=100)

remove

await Recipe.remove(key)

Remove a previously registered custom recipe.

await Recipe.remove("emerald_sword")