Skip to content
On this page
Common

KattonRecipeModificationApi

top.katton.api.modcommon/src/main/kotlin/top/katton/api/mod/KattonRecipeModificationApi.kt
Configuration for modifying existing recipe properties.

RecipeModificationConfig

RecipeModificationConfigCommonClass
kotlin
class RecipeModificationConfig( val recipeId: Identifier )

Configuration for modifying existing recipe properties.

This class provides a fluent API for modifying properties of existing recipes registered in Minecraft's recipe manager. Similar to KubeJS's recipe modification system.

Properties

PropertyDescription
recipeIdThe identifier of the recipe to modify

modifyRecipe

modifyRecipeCommonFunction
kotlin
@ApiStatus.Experimental
@ApiStatus.Experimental fun modifyRecipe(recipeId: String, configure: RecipeModificationConfig.() -> Unit)

Modifies an existing recipe's properties.

This function allows you to modify properties of recipes already registered in Minecraft's recipe manager. Changes are applied by re-registering the modified recipe through the datapack system.

Parameters

ParameterDescription
recipeIdThe identifier of the recipe to modify (e.g., "minecraft:iron_ingot_from_smelting")
configureConfiguration lambda for recipe modifications

modifyRecipe

modifyRecipeCommonFunction
kotlin
@ApiStatus.Experimental
@ApiStatus.Experimental fun modifyRecipe(recipeId: Identifier, configure: RecipeModificationConfig.() -> Unit)

Modifies an existing recipe's properties.

Parameters

ParameterDescription
recipeIdThe identifier of the recipe to modify
configureConfiguration lambda for recipe modifications

getRecipe

getRecipeCommonFunction
kotlin
fun getRecipe(recipeId: String): JsonObject?

Gets a recipe by its identifier as a JsonObject.

Parameters

ParameterDescription
recipeIdThe recipe identifier

Returns

The recipe as JsonObject, or null if not found

getRecipe

getRecipeCommonFunction
kotlin
fun getRecipe(recipeId: Identifier): JsonObject?

Gets a recipe by its identifier as a JsonObject.

Parameters

ParameterDescription
recipeIdThe recipe identifier

Returns

The recipe as JsonObject, or null if not found

removeRecipe

removeRecipeCommonFunction
kotlin
fun removeRecipe(recipeId: String)

Removes a recipe by its identifier.

Parameters

ParameterDescription
recipeIdThe recipe identifier

removeRecipe

removeRecipeCommonFunction
kotlin
fun removeRecipe(recipeId: Identifier)

Removes a recipe by its identifier.

Parameters

ParameterDescription
recipeIdThe recipe identifier