You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Created an issue per @sciwhiz12 's recommendation/request.
Feature Suggestion: Provide RegistryAccess for VillagerTradesEvent and WandererTradesEvent
Currently, neither the VillagerTradesEvent nor the WandererTradesEvent has access to a RegistryAccess instance. This limitation affects mods that rely on DatapackRegistry values to create specific ItemStack objects. According to the documentation, both events are triggered during reload by the TagsUpdatedEvent. However, neither event inherits from TagsUpdatedEvent nor receives a reference to RegistryAccess, making it impossible to access data from datapack registries.
Example Use Case
In my current mod, I have a "Drone/Princess/Queen"-variant item that contains all the species information and attributes as part of a Genome object (stored as a DataComponent), which is generated from the IAllele representing the species. Since IAllele is a DatapackRegistry object, I am unable to access the IAllele from the DatapackRegistry using its corresponding ResourceKey<IAllele>.
Proposed Solution
While it is possible to access the server instance through ServerLifecycleHooks, a more elegant solution would be to pass down the RegistryAccess provided by the TagsUpdatedEvent at some point in the event chain. This would make it easier to have access to datapack registries and allow mod developers to utilize DatapackRegistry values more effectively.
The text was updated successfully, but these errors were encountered:
I can actually see this being useful in my mod's case soon too, I can't see this PR being too difficult at all, I'll sketch up a draft PR when I get home
While we're adding this to these events, might as well also add RegistryAccess to RegisterBrewingRecipesEvent too (would be nice for me, as I have a mod that needs to be installed on both client and server and would like to add data-pack potion recipes)
Created an issue per @sciwhiz12 's recommendation/request.
Feature Suggestion: Provide
RegistryAccess
forVillagerTradesEvent
andWandererTradesEvent
Currently, neither the VillagerTradesEvent nor the WandererTradesEvent has access to a
RegistryAccess
instance. This limitation affects mods that rely onDatapackRegistry
values to create specificItemStack
objects. According to the documentation, both events are triggered during reload by the TagsUpdatedEvent. However, neither event inherits fromTagsUpdatedEvent
nor receives a reference toRegistryAccess
, making it impossible to access data from datapack registries.Example Use Case
In my current mod, I have a "Drone/Princess/Queen"-variant item that contains all the species information and attributes as part of a
Genome
object (stored as a DataComponent), which is generated from theIAllele
representing the species. Since IAllele is aDatapackRegistry
object, I am unable to access theIAllele
from theDatapackRegistry
using its correspondingResourceKey<IAllele>
.Proposed Solution
While it is possible to access the server instance through
ServerLifecycleHooks
, a more elegant solution would be to pass down theRegistryAccess
provided by theTagsUpdatedEvent
at some point in the event chain. This would make it easier to have access to datapack registries and allow mod developers to utilizeDatapackRegistry
values more effectively.The text was updated successfully, but these errors were encountered: