ModelVariantProvider

public interface ModelVariantProvider

Interface for model variant providers.

Model variant providers hook the resolution of ModelIdentifiers. In vanilla, this is the part where a "minecraft:stone#normal" identifier triggers the loading of a "minecraft:models/stone" model (ModelResourceProvider handles the later step).

The most common use of this is to cooperate with a ModelAppender, but it can also allow you to add your own block- or item-state formats. To trigger the loading of another model, use the passed ModelProviderContext.

As every model loading is instantiated with a new provider, it is safe (and recommended!) to cache information.

Keep in mind that only *one* ModelVariantProvider may respond to a given model at any time.

Functions

loadModelVariant
Link copied to clipboard
@Nullable()
abstract UnbakedModel loadModelVariant(ModelIdentifier modelId, ModelProviderContext context)
The model identifier, complete with variant.

Sources

jvm source
Link copied to clipboard