Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Is it possible during the GatherDataEvent event to do things like iterate through the recipes of another mod that you have as a dependency?

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.

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.

  • 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.

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.

  • Author

If there is a datapack altering these tags, would it be loaded before or after this event?

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.