Interface ModelModifier.OnLoad.Context
- Enclosing interface:
ModelModifier.OnLoad
@NonExtendable
public static interface ModelModifier.OnLoad.Context
The context for an on load model modification event.
-
Method Summary
Modifier and TypeMethodDescriptionLoads a model using anIdentifier
orModelIdentifier
, or gets it if it was already loaded.id()
The identifier of this model (may be aModelIdentifier
).loader()
The current model loader instance, which changes between resource reloads.
-
Method Details
-
id
Identifier id()The identifier of this model (may be aModelIdentifier
).For item models, only the
ModelIdentifier
with theinventory
variant is passed, and not the corresponding plain identifier. -
getOrLoadModel
Loads a model using anIdentifier
orModelIdentifier
, or gets it if it was already loaded.- Parameters:
id
- the model identifier- Returns:
- the unbaked model, or a missing model if it is not present
-
loader
ModelLoader loader()The current model loader instance, which changes between resource reloads.Do not call
ModelLoader.getOrLoadModel(net.minecraft.util.Identifier)
as it does not supported nested model resolution; usegetOrLoadModel(net.minecraft.util.Identifier)
from the context instead.
-