recipes#
ingredients#
recipe#
- class RecipeBase(
- *,
- type: str = '',
- result_count: int = 1,
- category: str | None = None,
- group: str | None = None,
- result: Ingr | None = None,
- manual_priority: int | None = None,
- smithed_crafter_command: str | None = None,
Bases:
StMappingBase class for all recipe types.
- category: str | None = None[source]#
(Optional) The category of the recipe for organizing in the crafting book.
- result: Ingr | None = None[source]#
(Optional) The result item of the recipe. If None, defaults to the item being defined.
- manual_priority: int | None = None[source]#
(Optional) Manual priority for recipe button sorting in the ingame-manual. Used to remove buttons when too many are present.
- smithed_crafter_command: str | None = None[source]#
(Optional) Custom command to be used with Smithed Crafter recipes. If None, defaults to giving the loot table.
- classmethod from_dict(
- data: JsonDict | StMapping,
- item_id: str = '',
Create an object based on a dictionary.
- static validate_ingredient(
- ingredient: Ingr,
- name: str = 'Ingredient',
Validate a single ingredient dictionary.
- static validate_ingredients_list(
- ingredients: list[Ingr],
Validate a list of ingredients.
- class CraftingShapedRecipe(
- shape: list[str],
- ingredients: dict[str, Ingr],
- *,
- type: str = '',
- result_count: int = 1,
- category: str | None = None,
- group: str | None = None,
- result: Ingr | None = None,
- manual_priority: int | None = None,
- smithed_crafter_command: str | None = None,
Bases:
RecipeBaseRecipe for shaped crafting.
>>> from stewbeet import * >>> recipe = CraftingShapedRecipe( ... shape=["II", "CC", "CC"], ... ingredients={"I":Ingr("minecraft:iron_ingot"), "C": Ingr("simplunium_ingot")} ... ) >>> recipe.shape ['II', 'CC', 'CC'] >>> recipe.ingredients['I'] {'item': 'minecraft:iron_ingot'} >>> recipe.ingredients['C'] {'components': {'minecraft:custom_data': {'your_namespace': {'simplunium_ingot': True}}}}
Shape exceeding 3 rows raises ValueError:
>>> try: ... CraftingShapedRecipe(shape=["I", "I", "I", "I"], ingredients={"I": Ingr("minecraft:iron_ingot")}) ... except ValueError as e: ... "3 rows" in str(e) True
Symbol defined in ingredients but absent from shape raises ValueError:
>>> try: ... CraftingShapedRecipe(shape=["II"], ingredients={"I": Ingr("minecraft:iron_ingot"), "X": Ingr("minecraft:gold_ingot")}) ... except ValueError as e: ... "must appear in the shape" in str(e) True
Rows with inconsistent lengths raise ValueError:
>>> try: ... CraftingShapedRecipe(shape=["II", "I"], ingredients={"I": Ingr("minecraft:iron_ingot")}) ... except ValueError as e: ... "same number of columns" in str(e) True
- class CraftingShapelessRecipe(
- ingredients: list[Ingr],
- *,
- type: str = '',
- result_count: int = 1,
- category: str | None = None,
- group: str | None = None,
- result: Ingr | None = None,
- manual_priority: int | None = None,
- smithed_crafter_command: str | None = None,
Bases:
RecipeBaseRecipe for shapeless crafting.
>>> from stewbeet import * >>> recipe = CraftingShapelessRecipe(ingredients=[Ingr("minecraft:iron_ingot"), Ingr("minecraft:copper_ingot")]) >>> len(recipe.ingredients) 2 >>> recipe.type 'crafting_shapeless'
Non-list ingredients raises ValueError:
>>> try: ... CraftingShapelessRecipe(ingredients=Ingr("minecraft:iron_ingot")) # type: ignore[arg-type] ... except ValueError as e: ... "must be a list" in str(e) True
- class SmeltingRecipe(
- ingredient: Ingr,
- experience: float = 0.0,
- cookingtime: int = 200,
- *,
- type: str = '',
- result_count: int = 1,
- category: str | None = None,
- group: str | None = None,
- result: Ingr | None = None,
- manual_priority: int | None = None,
- smithed_crafter_command: str | None = None,
Bases:
RecipeBaseRecipe for smelting in a furnace.
>>> from stewbeet import * >>> recipe = SmeltingRecipe(ingredient=Ingr("minecraft:iron_ore"), experience=0.7, cookingtime=200) >>> recipe.experience 0.7 >>> recipe.cookingtime 200
Non-numeric experience raises ValueError:
>>> try: ... SmeltingRecipe(ingredient=Ingr("minecraft:iron_ore"), experience="high", cookingtime=200) # type: ignore[arg-type] ... except ValueError as e: ... "Experience must be a float or int" in str(e) True
Non-integer cookingtime raises ValueError:
>>> try: ... SmeltingRecipe(ingredient=Ingr("minecraft:iron_ore"), experience=0.7, cookingtime=1.5) # type: ignore[arg-type] ... except ValueError as e: ... "Cookingtime must be an int" in str(e) True
- class BlastingRecipe(
- ingredient: Ingr,
- experience: float = 0.0,
- cookingtime: int = 100,
- *,
- type: str = '',
- result_count: int = 1,
- category: str | None = None,
- group: str | None = None,
- result: Ingr | None = None,
- manual_priority: int | None = None,
- smithed_crafter_command: str | None = None,
Bases:
RecipeBaseRecipe for blasting in a blast furnace.
>>> from stewbeet import * >>> recipe = BlastingRecipe(ingredient=Ingr("minecraft:iron_ore"), experience=0.7, cookingtime=100) >>> recipe.experience 0.7 >>> recipe.cookingtime 100
- class SmokingRecipe(
- ingredient: Ingr,
- experience: float = 0.0,
- cookingtime: int = 100,
- *,
- type: str = '',
- result_count: int = 1,
- category: str | None = None,
- group: str | None = None,
- result: Ingr | None = None,
- manual_priority: int | None = None,
- smithed_crafter_command: str | None = None,
Bases:
RecipeBaseRecipe for smoking in a smoker.
>>> from stewbeet import * >>> recipe = SmokingRecipe(ingredient=Ingr("minecraft:chicken"), experience=0.35, cookingtime=100) >>> recipe.experience 0.35 >>> recipe.cookingtime 100
- class CampfireCookingRecipe(
- ingredient: Ingr,
- experience: float,
- cookingtime: int,
- *,
- type: str = '',
- result_count: int = 1,
- category: str | None = None,
- group: str | None = None,
- result: Ingr | None = None,
- manual_priority: int | None = None,
- smithed_crafter_command: str | None = None,
Bases:
RecipeBaseRecipe for cooking on a campfire.
>>> from stewbeet import * >>> recipe = CampfireCookingRecipe(ingredient=Ingr("minecraft:chicken"), experience=0.35, cookingtime=600) >>> recipe.experience 0.35 >>> recipe.cookingtime 600
- written_cooking_time(
- recipe: SmeltingRecipe | BlastingRecipe | SmokingRecipe | CampfireCookingRecipe,
The “cookingtime” to write so the recipe takes
recipe.cookingtimeticks in its own block.Since 26.3, blast furnaces and smokers get their double speed from their fuel, so their recipes store the furnace duration.
>>> written_cooking_time(BlastingRecipe(ingredient=Ingr("minecraft:iron_ore"), cookingtime=100)) 200
- class SmithingTransformRecipe(
- template: Ingr,
- base: Ingr,
- addition: Ingr,
- *,
- type: str = '',
- result_count: int = 1,
- category: str | None = None,
- group: str | None = None,
- result: Ingr | None = None,
- manual_priority: int | None = None,
- smithed_crafter_command: str | None = None,
Bases:
RecipeBaseRecipe for smithing table transformation.
>>> from stewbeet import * >>> recipe = SmithingTransformRecipe( ... template=Ingr("minecraft:netherite_upgrade_smithing_template"), ... base=Ingr("minecraft:diamond_sword"), ... addition=Ingr("minecraft:netherite_ingot") ... ) >>> recipe.template['item'] 'minecraft:netherite_upgrade_smithing_template'
- class SmithingTrimRecipe(
- template: Ingr,
- base: Ingr,
- addition: Ingr,
- pattern: str,
- *,
- type: str = '',
- result_count: int = 1,
- category: str | None = None,
- group: str | None = None,
- result: Ingr | None = None,
- manual_priority: int | None = None,
- smithed_crafter_command: str | None = None,
Bases:
RecipeBaseRecipe for applying armor trims.
>>> from stewbeet import * >>> recipe = SmithingTrimRecipe( ... template=Ingr("minecraft:spire_armor_trim_smithing_template"), ... base=Ingr("minecraft:netherite_chestplate"), ... addition=Ingr("minecraft:diamond"), ... pattern="minecraft:spire_armor_trim_smithing_template" ... ) >>> recipe.addition['item'] 'minecraft:diamond'
- class StonecuttingRecipe(
- ingredient: Ingr,
- *,
- type: str = '',
- result_count: int = 1,
- category: str | None = None,
- group: str | None = None,
- result: Ingr | None = None,
- manual_priority: int | None = None,
- smithed_crafter_command: str | None = None,
Bases:
RecipeBaseRecipe for stonecutting.
>>> from stewbeet import * >>> recipe = StonecuttingRecipe(ingredient=Ingr("minecraft:stone")) >>> recipe.ingredient['item'] 'minecraft:stone'
- class PulverizingRecipe(
- ingredient: Ingr,
- *,
- type: str = '',
- result_count: int = 1,
- category: str | None = None,
- group: str | None = None,
- result: Ingr | None = None,
- manual_priority: int | None = None,
- smithed_crafter_command: str | None = None,
Bases:
RecipeBaseCustom recipe for SimplEnergy pulverizing.
>>> from stewbeet import * >>> recipe = PulverizingRecipe(ingredient=Ingr("minecraft:iron_ore")) >>> recipe.ingredient['item'] 'minecraft:iron_ore'
- class AwakenedForgeRecipe(
- ingredients: list[Ingr],
- particle: str | None = None,
- *,
- type: str = '',
- result_count: int = 1,
- category: str | None = None,
- group: str | None = None,
- result: Ingr | None = None,
- manual_priority: int | None = None,
- smithed_crafter_command: str | None = None,
Bases:
RecipeBaseCustom recipe for Stardust awakened forge.
>>> from stewbeet import * >>> recipe = AwakenedForgeRecipe(ingredients=[Ingr("stardust_fragment"), Ingr("minecraft:iron_ingot")]) >>> len(recipe.ingredients) 2
- class HardcodedRecipe(
- type: Literal['crafting_decorated_pot', 'crafting_special_armordye', 'crafting_special_bannerduplicate', 'crafting_special_bookcloning', 'crafting_special_firework_rocket', 'crafting_special_firework_star', 'crafting_special_firework_star_fade', 'crafting_special_mapcloning', 'crafting_special_mapextending', 'crafting_special_repairitem', 'crafting_special_shielddecoration', 'crafting_special_tippedarrow', 'crafting_transmute'] = '',
- *,
- result_count: int = 1,
- category: str | None = None,
- group: str | None = None,
- result: Ingr | None = None,
- manual_priority: int | None = None,
- smithed_crafter_command: str | None = None,
Bases:
RecipeBaseRecipe for special/hardcoded crafting types.
>>> recipe = HardcodedRecipe(type="crafting_special_armordye") >>> recipe.type 'crafting_special_armordye'
- Recipe = stewbeet.core.cls.recipes.recipe.CraftingShapedRecipe | stewbeet.core.cls.recipes.recipe.CraftingShapelessRecipe | stewbeet.core.cls.recipes.recipe.SmeltingRecipe | stewbeet.core.cls.recipes.recipe.BlastingRecipe | stewbeet.core.cls.recipes.recipe.SmokingRecipe | stewbeet.core.cls.recipes.recipe.CampfireCookingRecipe | stewbeet.core.cls.recipes.recipe.SmithingTransformRecipe | stewbeet.core.cls.recipes.recipe.SmithingTrimRecipe | stewbeet.core.cls.recipes.recipe.StonecuttingRecipe | stewbeet.core.cls.recipes.recipe.PulverizingRecipe | stewbeet.core.cls.recipes.recipe.AwakenedForgeRecipe | stewbeet.core.cls.recipes.recipe.HardcodedRecipe[source]#
Type alias for all recipe types (CraftingShapedRecipe | CraftingShapelessRecipe | …)