How to Generate a Custom Recipe at Runtime with ARRP
Registering a Recipe in Code
ARRP lets you build recipes without writing JSON files. You create a resource generator that runs during the resource reload and emits a recipe JSON into the virtual resource pack.
1. Create a class implementing ARRP's resource generator interface (the one that receives a ResourcePack output and a ResourceManager for conditions).
2. Inside its generation method, build a recipe object using ARRP's recipe builder helpers — for shaped recipes you specify a pattern and a key mapping characters to ingredients; for shapeless you list the ingredients directly.
3. Give the recipe an identifier under the recipes namespace path so it lands in the correct folder inside the generated pack.
4. Call the builder's output method to write the JSON into the pack.
5. Register your generator with ARRP's API entry point so it is invoked on every resource reload.
Testing It In-Game
After registering, run a resource reload (the vanilla reload command works) so ARRP regenerates the pack. Open the recipe book or a crafting table and confirm your recipe appears. If it does not, check that the identifier path matches the recipe type folder and that all ingredient identifiers are valid.
Because ARRP merges with normal resource packs, a datapack or pack that overrides the same recipe id will take priority — keep your ids unique to avoid silent conflicts.