Posted May 22, 20232 yr Is it possible during the GatherDataEvent event to do things like iterate through the recipes of another mod that you have as a dependency?
May 22, 20232 yr If you mean the real recipe objects, then no. Recipes are loaded when the datapacks are loaded. i.e. when the game loads a save Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
May 22, 20232 yr 2 hours ago, TaeoG said: Is it possible during the GatherDataEvent event to do things like iterate through the recipes of another mod that you have as a dependency? Depends on the context. If you just need to see whether the recipe exists, then yes; you can use `ExistingFileHelper#exists` to check. However, if you need to check the contents of the recipe, you would need to load them yourself because I don't believe that packs are loaded during data generation. However, you should generally only need the first case. Additionally, you would have to declare `--existing-mod', '<modid>' as one of the arguments in your data configuration.
May 22, 20232 yr Author Ah that's a bummer, but not terribly surprising. My hope was to find all items that meet certain criteria, like having something in their recipe, and put those items in a tag. I can do it by hand of course but it gets unwieldy.
May 22, 20232 yr 2 hours ago, TaeoG said: My hope was to find all items that meet certain criteria, like having something in their recipe, and put those items in a tag. It would probably be better to do that in code when recipes are loaded normally. I would use `TagsUpdatedEvent` as it is guaranteed to be executed after recipes are loaded on the server. I'm suggesting this event as `RecipesUpdatedEvent` is only on the client.
May 22, 20232 yr Author If there is a datapack altering these tags, would it be loaded before or after this event?
May 23, 20232 yr 13 hours ago, TaeoG said: If there is a datapack altering these tags, would it be loaded before or after this event? All datagen entries are loaded before this event iirc. Though, I just remembered there was the `OnDatapackSyncEvent` which happens literally after everything is loaded on the server except for functions and structures, which you don't care about.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.