Class RecipesReceivedEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.RecipesReceivedEvent

public class RecipesReceivedEvent extends net.neoforged.bus.api.Event
This event is fired on the client when it has finished receiving recipe data from the server. This will be the case shortly after first entering the world, and whenever the server decides to reload its datapacks. Note that recipe data will only be sent for recipe types requested using OnDatapackSyncEvent.sendRecipes(net.minecraft.world.item.crafting.RecipeType<?>...) on the server-side.

You should clean up any data you kept from this event when the player disconnects, for example when ClientPlayerNetworkEvent.LoggingOut is fired.

These events are fired on the main event bus, only on the logical client.

  • Field Details

  • Constructor Details

    • RecipesReceivedEvent

      @Internal public RecipesReceivedEvent(Set<RecipeType<?>> recipeTypes, RecipeMap recipeMap)
  • Method Details

    • getRecipeTypes

      public Set<RecipeType<?>> getRecipeTypes()
      Returns:
      The recipe types that were requested by mods on the server to be sent to the client. This may be a subset of available recipes types or even empty if no mods requested recipes to be sent.
    • getRecipeMap

      public RecipeMap getRecipeMap()
      Returns:
      The recipes received from the server.