Documentation Index Fetch the complete documentation index at: https://mintlify.com/ProfessorFichte/More-RPG-Classes/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The SmithingRecipeGenerator is an abstract class that provides a powerful API for generating Minecraft smithing transform recipes. It supports cross-mod compatibility with automatic load conditions for both Fabric and NeoForge.
This class is located in net.more_rpg_classes.datagen.SmithingRecipeGenerator.
Class Definition
public abstract class SmithingRecipeGenerator implements DataProvider
Constructor
The Fabric data output handler
Your mod ID for recipe paths
public SmithingRecipeGenerator ( FabricDataOutput output, String modId) {
this . output = output;
this . modId = modId;
}
Abstract Methods
generate
Implement this method to generate your recipes. This is where you call the recipe creation methods.
public abstract void generate ();
Recipe Methods with Load Conditions
These methods create recipes that only load when specific mods are present.
Creates a smithing transform recipe with Fabric and NeoForge load conditions.
Recipe name (without namespace)
Base item that will be upgraded
template
Item | Identifier
required
Template item (use Identifier for items from unloaded mods)
addition
Item | Identifier
required
Addition/ingredient item (use Identifier for items from unloaded mods)
Result item after transformation
Required mod ID (e.g., “armory_rpgs”)
public void createSmithingTransformRecipe (
String name,
Item base,
Object template,
Object addition,
Item result,
String requiredMod
)
Multiple Required Mods
Overload for multiple mod dependencies:
public void createSmithingTransformRecipe (
String name,
Item base,
Object template,
Object addition,
Item result,
String [] requiredMods
)
createArmorSetUpgrade
Automatically creates smithing recipes for all 4 armor pieces (head, chest, legs, feet).
Base name for the recipes (e.g., “bounty_hunter_from_deadeye”)
Base armor set to upgrade from
template
Item | Identifier
required
Template item for all 4 pieces
addition
Item | Identifier
required
Addition item for all 4 pieces
Result armor set after upgrade
public void createArmorSetUpgrade (
String recipeBaseName,
Armor . Set baseSet,
Object template,
Object addition,
Armor . Set resultSet,
String requiredMod
)
This method automatically generates 4 recipes with suffixes: _head, _chest, _legs, _feet
Multiple Required Mods
Overload for multiple mod dependencies:
public void createArmorSetUpgrade (
String recipeBaseName,
Armor . Set baseSet,
Object template,
Object addition,
Armor . Set resultSet,
String [] requiredMods
)
Recipe Methods without Load Conditions
These methods create recipes for items that are always available (from your own mod).
createSimpleSmithingRecipe
Creates a smithing transform recipe without load conditions.
template
Item | Identifier
required
Template item
addition
Item | Identifier
required
Addition item
public void createSimpleSmithingRecipe (
String name,
Item base,
Object template,
Object addition,
Item result
)
createSimpleArmorSetUpgrade
Creates recipes for all 4 armor pieces without load conditions.
public void createSimpleArmorSetUpgrade (
String recipeBaseName,
Armor . Set baseSet,
Object template,
Object addition,
Armor . Set resultSet
)
Usage Examples
Basic Recipe with Load Condition
public class MySmithingRecipes extends SmithingRecipeGenerator {
public MySmithingRecipes ( FabricDataOutput output ) {
super (output, "mymod" );
}
@ Override
public void generate () {
// Single recipe with cross-mod support
createSmithingTransformRecipe (
"upgrade_sword" ,
Items . IRON_SWORD ,
Identifier . of ( "armory_rpgs" , "upgrade_template" ),
Identifier . of ( "armory_rpgs" , "rare_gem" ),
MyItems . LEGENDARY_SWORD ,
"armory_rpgs"
);
}
}
Armor Set Upgrade
@ Override
public void generate () {
// Upgrades all 4 armor pieces at once
createArmorSetUpgrade (
"bounty_hunter_upgrade" ,
DeadeyeArmor . SET ,
Identifier . of ( "armory_rpgs" , "class_token" ),
Identifier . of ( "armory_rpgs" , "bounty_hunter_essence" ),
BountyHunterArmor . SET ,
"armory_rpgs"
);
}
Multiple Mod Dependencies
@ Override
public void generate () {
createSmithingTransformRecipe (
"special_upgrade" ,
MyItems . BASE_ARMOR ,
Identifier . of ( "mod_a" , "template" ),
Identifier . of ( "mod_b" , "ingredient" ),
MyItems . RESULT_ARMOR ,
new String []{ "mod_a" , "mod_b" }
);
}
Simple Recipe (No Load Conditions)
@ Override
public void generate () {
// For items always available in your mod
createSimpleSmithingRecipe (
"basic_upgrade" ,
MyItems . BASIC_SWORD ,
Items . NETHERITE_UPGRADE_SMITHING_TEMPLATE ,
Items . NETHERITE_INGOT ,
MyItems . ENHANCED_SWORD
);
}
Registering the Provider
public class MyDatagen implements DataGeneratorEntrypoint {
@ Override
public void onInitializeDataGenerator ( FabricDataGenerator fabricDataGenerator ) {
FabricDataGenerator . Pack pack = fabricDataGenerator . createPack ();
pack . addProvider (MySmithingRecipes ::new );
}
}
Generated JSON Structure
The generator creates recipes with the following structure:
{
"fabric:load_conditions" : [
{
"condition" : "fabric:all_mods_loaded" ,
"values" : [ "armory_rpgs" ]
}
],
"neoforge:conditions" : [
{
"type" : "neoforge:mod_loaded" ,
"modid" : "armory_rpgs"
}
],
"type" : "minecraft:smithing_transform" ,
"template" : {
"item" : "armory_rpgs:upgrade_template"
},
"base" : {
"item" : "minecraft:iron_sword"
},
"addition" : {
"item" : "armory_rpgs:rare_gem"
},
"result" : {
"id" : "mymod:legendary_sword" ,
"count" : 1
}
}
Important Notes
When referencing items from other mods that may not be loaded, always use Identifier instead of Item. Using Item for unloaded mods will cause the item to resolve to minecraft:air and throw an error.
The createArmorSetUpgrade methods automatically extract the armor set name from the result set and append appropriate suffixes (_head, _chest, _legs, _feet) to recipe names.
Data Generation Helpers Main data generation providers
Advancement Helpers Create Spell Engine advancements