Minecraft: Stripped Logs In Stonecutter Recipe Generator

This is a small little program I wrote in C# to make crafting recipes for the different log types on the stone cutter to make the stripped versions of them. Nothing too fancy going on here, just defining some arrays and looping over them with a recipe template.

GitHub GIST: https://gist.github.com/XerShade/5ae508b2559d6f53876679f46a7b682d

const string OUTPUT_PATH = "PATH_TO_DATAPACK\\NAMESPACE\\recipe";
const string STRIPED_LOG_TEMPLATE = "{\r\n  \"type\": \"minecraft:stonecutting\",\r\n  \"ingredient\": [\r\n    \"minecraft:{LOG_TYPE}_{WOOD_TYPE}\"\r\n  ],\r\n  \"result\": {\r\n    \"id\": \"minecraft:stripped_{LOG_TYPE}_{WOOD_TYPE}\",\r\n    \"count\": 1\r\n  }\r\n}";

string[] WOOD_TYPES = ["wood", "log"];
string[] LOG_TYPES = ["acacia", "birch", "spruce", "oak", "dark_oak", "jungle", "cherry", "mangrove", "pale_oak"];

string[] NETHER_WOOD_TYPES = ["hyphae", "stem"];
string[] NETHER_LOG_TYPES = ["crimson", "warped"];

string[] BAMBOO_WOOD_TYPES = ["block"];
string[] BAMBOO_LOG_TYPES = ["bamboo"];

foreach (string wood_type in WOOD_TYPES)
{
    foreach (string log_type in LOG_TYPES)
    {
        Console.WriteLine($"Generating stone cutting stripping recipe for 'stripped_{log_type}_{wood_type}'.");

        string recipe = STRIPED_LOG_TEMPLATE.Replace("{LOG_TYPE}", log_type).Replace("{WOOD_TYPE}", wood_type);
        string path = Path.Combine(OUTPUT_PATH, $"stripped_{log_type}_{wood_type}.json");

        StreamWriter fs = new(path, false);
        fs.WriteLine(recipe);
        fs.Close();
    }
}

foreach (string wood_type in NETHER_WOOD_TYPES)
{
    foreach (string log_type in NETHER_LOG_TYPES)
    {
        Console.WriteLine($"Generating stone cutting stripping recipe for 'stripped_{log_type}_{wood_type}'.");

        string recipe = STRIPED_LOG_TEMPLATE.Replace("{LOG_TYPE}", log_type).Replace("{WOOD_TYPE}", wood_type);
        string path = Path.Combine(OUTPUT_PATH, $"stripped_{log_type}_{wood_type}.json");

        StreamWriter fs = new(path, false);
        fs.WriteLine(recipe);
        fs.Close();
    }
}

foreach (string wood_type in BAMBOO_WOOD_TYPES)
{
    foreach (string log_type in BAMBOO_LOG_TYPES)
    {
        Console.WriteLine($"Generating stone cutting stripping recipe for 'stripped_{log_type}_{wood_type}'.");

        string recipe = STRIPED_LOG_TEMPLATE.Replace("{LOG_TYPE}", log_type).Replace("{WOOD_TYPE}", wood_type);
        string path = Path.Combine(OUTPUT_PATH, $"stripped_{log_type}_{wood_type}.json");

        StreamWriter fs = new(path, false);
        fs.WriteLine(recipe);
        fs.Close();
    }
}

I made this because I wanted to add all these recipes, but doing it manually felt like too much of a chore. Probably took the same amount of time if not longer to make this, but if anyone needs to do the same here you go. Just replace DATAPACK_PATH and NAMESPACE with the appropriate values and run it in a top level Program.cs

Thanks for reading,
-XerShade

Leave a Reply