Class ModifyRecipeJsonsEvent
This event allows mods to modify the raw JSON data directly, avoiding the need to intercept and reprocess already-deserialized recipe instances.
This event exists primarily for mods that need to perform bulk modifications to recipes, such as for modpack integration in a broadly compatible way. For typical use cases, defining or overriding recipes via standard JSON files is strongly preferred.
The provided map must be modified in-place to affect the upcoming deserialization process.
Note that at this stage it is not guaranteed that all recipes will be deserialized, as their
conditions have not yet been evaluated. Condition evaluation is performed via
ConditionalOps, which is exposed for convenience.
Fired on the logical server via the NeoForge.EVENT_BUS.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RegistryOps<JsonElement> private final Map<Identifier, JsonElement> private final RegistryOps.RegistryInfoLookup -
Constructor Summary
ConstructorsConstructorDescriptionModifyRecipeJsonsEvent(RegistryOps<JsonElement> ops, Map<Identifier, JsonElement> recipeJsons) -
Method Summary
Modifier and TypeMethodDescriptiongetOps()<T> Optional<RegistryOps.RegistryInfo<T>> lookup(ResourceKey<? extends Registry<? extends T>> registryKey) <T> RegistryOps.RegistryInfo<T> lookupOrThrow(ResourceKey<? extends Registry<? extends T>> registryKey)
-
Field Details
-
registryInfoLookup
-
ops
-
recipeJsons
-
-
Constructor Details
-
ModifyRecipeJsonsEvent
public ModifyRecipeJsonsEvent(RegistryOps<JsonElement> ops, Map<Identifier, JsonElement> recipeJsons)
-
-
Method Details
-
getOps
-
getRecipeJsons
-
lookup
public <T> Optional<RegistryOps.RegistryInfo<T>> lookup(ResourceKey<? extends Registry<? extends T>> registryKey) -
lookupOrThrow
public <T> RegistryOps.RegistryInfo<T> lookupOrThrow(ResourceKey<? extends Registry<? extends T>> registryKey)
-