-
-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VillagerTradesEvent and WandererTradesEvent has no way to access DatapackRegistries. #1527
Comments
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 |
@Lanse505 PR for it done, should be merged in a couple days if no other additions or changes are needed |
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: