ValidatedRegistryType
provides a simple way to create validation for registered object types, as long as the registry is defaulted. This lets your config provide relevant objects instead of having to map them from identifiers yourself.
Heads up!
There is also a method overload with a default parameter that bypasses the DefaultedRegistry
restriction.
// the resulting field will directly provide items, not identifiers for itemspublic ValidatedField<Item> mapped = ValidatedRegistryType.of(Registries.ITEM);
Heads up!
See the documentation page here 🗗