This documentation will be adding a new type of crafting based on the Fabric Documentation for Custom Recipe Types. If you are unfamiliar with how vanilla structures a recipe type, you will want to follow that tutorial first.
To add a new way of crafting, we'll first create a client recipe type.
To do this, create a class that implements ReliableClientRecipeType and override the required methods:
Example
public class UpgradingClientRecipeType implements ReliableClientRecipeType {//Create an instance of your client recipe type here//Relevant for next stepsprotected static final ReliableClientRecipeType INSTANCE = new ReliableClientRecipeType();@Overridepublic Component getDisplayName() {return Component.literal("Upgrading"); //This is the name of your recipe type, displayed later in the recipe view.}@Overridepublic int getDisplayWidth() {return 100; //The width of your type's gui texture}@Overridepublic int getDisplayHeight() {return 40; //The height of your type's gui texture}@Overridepublic @Nullable Identifier getGuiTexture() {return Identifier.fromNamespaceAndPath("example-mod", "textures/gui/type/upgrading.png"); // The background texture of your recipe.}@Overridepublic int getSlotCount() {return 3; //The amount of slots required to show a single recipe of this type - this includes two inputs and a result.}@Overridepublic void placeSlots(RecipeViewMenu.SlotDefinition slotDefinition) {//Tell RRV where your slots are located by calling slotDefinition.addItemSlot();//NOTE: Slot position is relative to your gui textureslotDefinition.addItemSlot(0, 10, 20);slotDefinition.addItemSlot(1, 40, 20);slotDefinition.addItemSlot(2, 60, 20);}@Overridepublic Identifier getId() {return Identifier.fromNamespaceAndPath("example-mod", "upgrading"); // The unique id of this recipe type}@Overridepublic ItemStack getIcon() {return ItemStack.EMPTY; //The icon displayed in the recipe view screen}@Overridepublic List<ItemStack> getCraftReferences() {return List.of(); //Return a list of blocks/items that can be used to process your recipes (e.g. for Smelting it would be the Furnace)}}
With your client recipe type created, you can move on to creating the Client Recipes themselves.