Loading...
Loading...
Create custom crafting recipes for Hytale plugins including shaped, shapeless, processing, and blueprint recipes. Use when asked to "add crafting recipe", "create recipe", "make craftable item", "add smelting recipe", or "custom crafting".
npx skill4agent add mnkyarts/hytale-skills hytale-crafting-recipes| BenchType | Description | Example |
|---|---|---|
| Standard grid-based crafting | Crafting Table |
| Time-based conversion with fuel | Furnace, Smelter |
| Blueprint/schematic crafting | Advanced Workbench |
| Multi-block construction | Building Bench |
| Pocket crafting (no bench) | Player inventory |
Recipe JSON → CraftingPlugin → BenchRecipeRegistry → Available in Bench UI{
"Input": [...],
"Output": [...],
"PrimaryOutput": "hytale:iron_sword",
"BenchRequirement": [...],
"TimeSeconds": 0,
"KnowledgeRequired": false
}| Field | Required | Type | Description |
|---|---|---|---|
| Yes | Array | Required materials |
| Yes | Array | Resulting items |
| No | String | Main output item ID |
| No | Array | Required bench types |
| No | Number | Processing time (for Processing type) |
| No | Boolean | Must be learned first |
| No | String | Recipe category for UI |
{
"ItemId": "hytale:iron_ingot",
"Quantity": 3
}{
"ResourceTypeId": "hytale:ore",
"Quantity": 2
}{
"ItemTag": "wood_planks",
"Quantity": 4
}{
"Input": [
{ "ItemId": "hytale:iron_ingot", "Quantity": 2 },
{ "ItemId": "hytale:stick", "Quantity": 1 }
],
"Output": [
{ "ItemId": "hytale:iron_sword", "Quantity": 1 }
],
"BenchRequirement": [
{ "BenchType": "Crafting" }
]
}{
"Pattern": [
" I ",
" I ",
" S "
],
"Key": {
"I": { "ItemId": "hytale:iron_ingot" },
"S": { "ItemId": "hytale:stick" }
},
"Output": [
{ "ItemId": "hytale:iron_sword", "Quantity": 1 }
],
"BenchRequirement": [
{ "BenchType": "Crafting" }
]
}{
"Input": [
{ "ItemId": "hytale:diamond", "Quantity": 2 },
{ "ItemId": "hytale:stick", "Quantity": 1 }
],
"Output": [
{ "ItemId": "hytale:diamond_sword", "Quantity": 1 }
],
"Category": "Weapons",
"BenchRequirement": [
{ "BenchType": "Crafting" }
]
}{
"Input": [
{ "ItemTag": "log", "Quantity": 1 }
],
"Output": [
{ "ItemId": "hytale:wooden_planks", "Quantity": 4 }
],
"BenchRequirement": [
{ "BenchType": "Fieldcraft" }
]
}{
"Input": [
{ "ItemId": "hytale:iron_ore", "Quantity": 1 }
],
"Output": [
{ "ItemId": "hytale:iron_ingot", "Quantity": 1 }
],
"BenchRequirement": [
{ "BenchType": "Processing" }
],
"TimeSeconds": 10
}{
"Input": [
{ "ItemId": "hytale:raw_meat", "Quantity": 1 }
],
"Output": [
{ "ItemId": "hytale:cooked_meat", "Quantity": 1 },
{ "ItemId": "hytale:bone", "Quantity": 1, "Chance": 0.25 }
],
"BenchRequirement": [
{ "BenchType": "Processing" }
],
"TimeSeconds": 8
}{
"FuelItems": [
{ "ItemId": "hytale:coal", "BurnTime": 1600 },
{ "ItemId": "hytale:wood", "BurnTime": 300 },
{ "ItemTag": "planks", "BurnTime": 200 }
]
}{
"Input": [
{ "ItemId": "hytale:refined_iron", "Quantity": 5 },
{ "ItemId": "hytale:leather", "Quantity": 3 },
{ "ItemId": "hytale:ruby", "Quantity": 1 }
],
"Output": [
{ "ItemId": "hytale:enhanced_armor", "Quantity": 1 }
],
"BenchRequirement": [
{ "BenchType": "DiagramCrafting" }
],
"KnowledgeRequired": true,
"DiagramId": "hytale:enhanced_armor_blueprint"
}// Grant blueprint knowledge
player.getKnowledgeManager().learn("hytale:enhanced_armor_blueprint");
// Check if player knows recipe
boolean knows = player.getKnowledgeManager().hasKnowledge("hytale:enhanced_armor_blueprint");
// Remove knowledge
player.getKnowledgeManager().forget("hytale:enhanced_armor_blueprint");{
"Input": [
{ "ItemId": "hytale:stone_brick", "Quantity": 20 },
{ "ItemId": "hytale:iron_ingot", "Quantity": 4 },
{ "ItemId": "hytale:wooden_door", "Quantity": 1 }
],
"Output": [
{ "StructureId": "hytale:small_house" }
],
"BenchRequirement": [
{ "BenchType": "StructuralCrafting" }
],
"Preview": "structures/small_house_preview.json"
}"BenchRequirement": [
{ "BenchType": "Crafting" }
]"BenchRequirement": [
{ "BenchType": "Crafting" },
{ "BenchType": "DiagramCrafting" }
]"BenchRequirement": [
{
"BenchType": "Processing",
"BlockId": "hytale:blast_furnace"
}
]"BenchRequirement": [
{
"BenchType": "Crafting",
"MinTier": 2
}
]assets/
└── Server/
└── Content/
└── Recipes/
├── crafting/
│ ├── iron_sword.json
│ └── iron_pickaxe.json
├── processing/
│ └── iron_smelting.json
└── diagrams/
└── enhanced_armor.jsonpublic class MyPlugin extends JavaPlugin {
public MyPlugin(JavaPluginInit init) {
super(init);
}
@Override
protected void setup() {
// Get the crafting registry
CraftingRecipeRegistry registry = getCraftingRecipeRegistry();
// Register a recipe programmatically
CraftingRecipe recipe = CraftingRecipe.builder()
.input(ItemId.of("hytale:diamond"), 2)
.input(ItemId.of("hytale:stick"), 1)
.output(ItemId.of("hytale:diamond_sword"), 1)
.benchType(BenchType.Crafting)
.category("Weapons")
.build();
registry.register(recipe);
}
}CraftingRecipe recipe = CraftingRecipe.builder()
// Input materials
.input(ItemId.of("hytale:iron_ingot"), 5)
.input(ItemTag.of("gems"), 2)
.input(ResourceTypeId.of("hytale:magic_essence"), 1)
// Output items
.output(ItemId.of("hytale:magic_sword"), 1)
.secondaryOutput(ItemId.of("hytale:magic_dust"), 1, 0.5f) // 50% chance
// Requirements
.benchType(BenchType.DiagramCrafting)
.requiresKnowledge(true)
.category("Magic Weapons")
// Processing-specific
.processingTime(Duration.ofSeconds(15))
.build();{
"Input": [...],
"Output": [...],
"KnowledgeRequired": true,
"KnowledgeId": "mymod:secret_recipe"
}public class KnowledgeManager {
// Teach recipe from item (like recipe book)
public void teachFromItem(Player player, ItemStack recipeItem) {
if (recipeItem.is(Items.RECIPE_SCROLL)) {
String recipeId = recipeItem.getTag().getString("RecipeId");
player.getKnowledgeManager().learn(recipeId);
player.sendMessage("Learned: " + recipeId);
recipeItem.shrink(1);
}
}
// Teach recipe from NPC
public void teachFromNPC(Player player, String recipeId, int cost) {
if (player.getCurrency() >= cost) {
player.removeCurrency(cost);
player.getKnowledgeManager().learn(recipeId);
player.sendMessage("Purchased recipe knowledge!");
}
}
// Check available recipes for player
public List<CraftingRecipe> getAvailableRecipes(Player player, BenchType bench) {
return CraftingRecipeRegistry.getRecipes(bench).stream()
.filter(r -> !r.requiresKnowledge() ||
player.getKnowledgeManager().hasKnowledge(r.getKnowledgeId()))
.toList();
}
}| Category | Description |
|---|---|
| Pickaxes, axes, shovels |
| Swords, bows, staffs |
| Helmets, chestplates, etc. |
| Blocks, decorations |
| Consumables, cooking |
| Intermediate crafting materials |
| Enchanted items, potions |
| Everything else |
{
"Input": [...],
"Output": [...],
"Category": "MyMod:SpecialItems"
}// Iron Helmet
{
"Pattern": [
"III",
"I I"
],
"Key": {
"I": { "ItemId": "hytale:iron_ingot" }
},
"Output": [
{ "ItemId": "hytale:iron_helmet", "Quantity": 1 }
],
"Category": "Armor",
"BenchRequirement": [
{ "BenchType": "Crafting" }
]
}// Step 1: Ore to Raw Metal
{
"Input": [
{ "ItemId": "hytale:iron_ore", "Quantity": 1 }
],
"Output": [
{ "ItemId": "hytale:raw_iron", "Quantity": 1 }
],
"BenchRequirement": [
{ "BenchType": "Processing", "BlockId": "hytale:crusher" }
],
"TimeSeconds": 5
}
// Step 2: Raw Metal to Ingot
{
"Input": [
{ "ItemId": "hytale:raw_iron", "Quantity": 2 }
],
"Output": [
{ "ItemId": "hytale:iron_ingot", "Quantity": 1 }
],
"BenchRequirement": [
{ "BenchType": "Processing", "BlockId": "hytale:furnace" }
],
"TimeSeconds": 10
}{
"Input": [
{ "ItemId": "hytale:mysterious_ore", "Quantity": 1 }
],
"Output": [
{ "ItemId": "hytale:iron_ingot", "Quantity": 1 },
{ "ItemId": "hytale:gold_nugget", "Quantity": 1, "Chance": 0.3 },
{ "ItemId": "hytale:diamond", "Quantity": 1, "Chance": 0.05 }
],
"BenchRequirement": [
{ "BenchType": "Processing" }
],
"TimeSeconds": 15
}// Get all recipes for a bench type
List<CraftingRecipe> recipes = CraftingRecipeRegistry.getRecipes(BenchType.Crafting);
// Find recipe by output
Optional<CraftingRecipe> recipe = CraftingRecipeRegistry.findByOutput(
ItemId.of("hytale:diamond_sword")
);
// Check if player can craft
boolean canCraft = recipe.map(r -> r.canCraft(player)).orElse(false);
// Execute craft
if (canCraft) {
CraftResult result = recipe.get().craft(player);
if (result.isSuccess()) {
player.getInventory().addItem(result.getOutput());
}
}
// Get recipes by category
List<CraftingRecipe> weapons = CraftingRecipeRegistry.getByCategory("Weapons");
// Check materials
boolean hasMaterials = recipe.get().hasRequiredMaterials(player.getInventory());{namespace}:{material}_{item_type}
Examples:
- mymod:iron_sword
- mymod:diamond_pickaxe
- mymod:enchanted_bow// Debug command to test recipes
public class RecipeDebugCommand extends CommandBase {
public RecipeDebugCommand() {
super("recipedebug", "Debug recipe information");
}
@Override
protected void execute(CommandContext ctx) {
String recipeId = ctx.get(RECIPE_ID);
Optional<CraftingRecipe> recipe = CraftingRecipeRegistry.get(recipeId);
if (recipe.isEmpty()) {
ctx.sendError("Recipe not found: " + recipeId);
return;
}
CraftingRecipe r = recipe.get();
ctx.sendMessage("Recipe: " + r.getId());
ctx.sendMessage("Bench: " + r.getBenchType());
ctx.sendMessage("Inputs: " + r.getInputs().size());
ctx.sendMessage("Knowledge Required: " + r.requiresKnowledge());
}
}references/recipe-format.mdreferences/bench-configs.md