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 Summary

    Fields
    Modifier and Type
    Field
    Description
    private final net.minecraft.world.item.crafting.RecipeMap
     
    private final Set<net.minecraft.world.item.crafting.RecipeType<?>>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    RecipesReceivedEvent(Set<net.minecraft.world.item.crafting.RecipeType<?>> recipeTypes, net.minecraft.world.item.crafting.RecipeMap recipeMap)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.item.crafting.RecipeMap
     
    Set<net.minecraft.world.item.crafting.RecipeType<?>>
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • recipeTypes

      private final Set<net.minecraft.world.item.crafting.RecipeType<?>> recipeTypes
    • recipeMap

      private final net.minecraft.world.item.crafting.RecipeMap recipeMap
  • Constructor Details

    • RecipesReceivedEvent

      @Internal public RecipesReceivedEvent(Set<net.minecraft.world.item.crafting.RecipeType<?>> recipeTypes, net.minecraft.world.item.crafting.RecipeMap recipeMap)
  • Method Details

    • getRecipeTypes

      public Set<net.minecraft.world.item.crafting.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 net.minecraft.world.item.crafting.RecipeMap getRecipeMap()
      Returns:
      The recipes received from the server.