Interface ModelResolver

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ModelResolver
Model resolvers are able to provide a custom model for specific Identifiers. In vanilla, these Identifiers are converted to file paths and used to load a model from JSON. Since model resolvers override this process, they can be used to create custom model formats.

Only one resolver may provide a custom model for a certain Identifier. Thus, resolvers that load models using a custom format could conflict. To avoid conflicts, such resolvers may want to only load files with a mod-suffixed name or only load files that have been explicitly defined elsewhere.

If it is necessary to load and bake an arbitrary model that is not referenced normally, a model resolver can be used in conjunction with ModelLoadingPlugin.Context.addModels(net.minecraft.util.Identifier...) to directly load and bake custom model instances.

Model resolvers are invoked for every single model that will be loaded, so implementations should be as efficient as possible.

See Also: