Class RecipeSynchronization

java.lang.Object
net.fabricmc.fabric.api.recipe.v1.sync.RecipeSynchronization

public final class RecipeSynchronization extends Object
Since Minecraft 1.21.2, vanilla no longer syncs all recipes to the client automatically, opting into sending only required recipe book data.

This api can be used to enable Fabric's recipe sync for select RecipeSerializers, which will synchronize recipes to the client. See SynchronizedRecipes

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.resources.Identifier
    Event phase used for sending recipes to the client.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    synchronizeRecipeSerializer(net.minecraft.world.item.crafting.RecipeSerializer<?> serializer)
    Enables synchronization of recipes to the client, for recipes that can be handled by the provided RecipeSerializer.

    Methods inherited from class java.lang.Object

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

  • Method Details

    • synchronizeRecipeSerializer

      public static void synchronizeRecipeSerializer(net.minecraft.world.item.crafting.RecipeSerializer<?> serializer)
      Enables synchronization of recipes to the client, for recipes that can be handled by the provided RecipeSerializer.

      Only add recipe serializers that are provided by your own mod or vanilla. Blindly adding unchecked recipe serializers might cause bugs and crashes.

      This method should be called in the main mod initializer on both the client and the server.

      Parameters:
      serializer - the recipe serializer used to synchronize recipes to the client.