Getting all crafting recipes on 1.16

Started by GaussianWonder on Sat, 01/09/2021 - 12:14

Topic category: Help with modding (Java Edition)

Last seen on 21:07, 21. Jan 2021
Joined Jan 2021
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Getting all crafting recipes on 1.16
Sat, 01/09/2021 - 12:14

I can't find any way to get the crafting recipes + ingredients of all registered items :(

 

I don't necessarily want all of them at once (although that would be nice since I could be done with the whole process at config event by registering a hashmap)

 

What I want to know is the crafting recipe of an item that's on slot(0) of my machine.

 

I found only one post about this topic, but it is using mc 1.12. ForgeRegistries.RECIPES does not exist anymore and ForgeRegisitries.RECIPE_SERIALIZERS seems to deal with serialization only :(

 

for(Map.Entry<RegistryKey<IRecipeSerializer<?>>, IRecipeSerializer<?>> entry: ForgeRegistries.RECIPE_SERIALIZERS.getEntries()) {
            RegistryKey<IRecipeSerializer<?>> key = entry.getKey();
            IRecipeSerializer<?> value = entry.getValue();

            System.out.println("Key Location: " + key.getLocation());
            System.out.println("Key Registry Name: " + key.getRegistryName());

            System.out.println("Value Registry Name: " + value.getRegistryName());
        }

This didn't really help me either