Interface CustomRecipe
- All Known Implementing Classes:
CustomBlastingRecipe, CustomCampfireRecipe, CustomFurnaceRecipe, CustomPotionMix, CustomShapedRecipe, CustomShapelessRecipe, CustomSmithingTransformRecipe, CustomSmokingRecipe, CustomStonecuttingRecipe, CustomTransmuteRecipe, DisabledRecipe
public interface CustomRecipe
Represents a custom recipe structure defining the transformation of inputs to an output.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<CustomRecipe> Polymorphic codec for serializing and deserializing custom recipes. -
Method Summary
Modifier and TypeMethodDescription@NotNull net.kyori.adventure.key.KeygetKey()RecipeType<?> getType()Retrieves the structural type format associated with this recipe variant.default booleanreplace()Determines whether this custom recipe should silently override and replace a pre-existing recipe with the same key.
-
Field Details
-
CODEC
Polymorphic codec for serializing and deserializing custom recipes. It uses the "type" field to delegate serialization logic to the registeredRecipeType.
-
-
Method Details
-
getKey
@NotNull @NotNull net.kyori.adventure.key.Key getKey()- Returns:
- The unique namespaced identifier representing this recipe instance.
-
replace
default boolean replace()Determines whether this custom recipe should silently override and replace a pre-existing recipe with the same key.- Returns:
- True if the recipe acts as a replacement, false otherwise.
-
getType
RecipeType<?> getType()Retrieves the structural type format associated with this recipe variant.- Returns:
- The bound
RecipeType.
-