-
-
Notifications
You must be signed in to change notification settings - Fork 126
Geo Models (Geckolib3)
Geo models are GeckoLib's way of tying together your animatable's resource (json) files, its animation handling, and various other miscellaneous data.
All animatable objects in GeckoLib have a Geo Model of some kind, and as such it is required that you create one for each that you make.
To create a new Geo Model
, simply make a class that extends AnimatedGeoModel, then implement all the required methods:
This method should return the ResourceLocation
path to your .geo.json
model file for this animatable
This method should return the ResourceLocation
path to your .png
texture file for this animatable
This method should return the ResourceLocation
path to your .animation.json
animation file for this animatable
Example Geo Model
public class JackInTheBoxModel extends AnimatedGeoModel<JackInTheBoxItem> {
private static final ResourceLocation modelResource = new ResourceLocation(GeckoLib.ModID, "geo/jack.geo.json");
private static final ResourceLocation textureResource = new ResourceLocation(GeckoLib.ModID, "textures/item/jack.png");
private static final ResourceLocation animationResource = new ResourceLocation(GeckoLib.ModID, "animations/jackinthebox.animation.json");
@Override
public ResourceLocation getModelLocation(JackInTheBoxItem object) {
return modelResource;
}
@Override
public ResourceLocation getTextureLocation(JackInTheBoxItem object) {
return textureResource;
}
@Override
public ResourceLocation getAnimationFileLocation(JackInTheBoxItem object) {
return animationResource;
}
}
As a minimum, GeckoLib requires that your asset (model, texture, animation) files be in certain directories in your resources folder. This is to allow for GeckoLib to easily find them. Once they are in these directories however, you are free to put them in any sub-directory of that folder, as long as your GeoModel
instance's methods reflect those locations.
Model files have to go in resources/assets/<modid>/geo
, or in any sub-directory thereof.
Animation files have to go in resources/assets/<modid>/animations
, or in any sub-directory thereof.
Textures are the same as in vanilla. They must go in resources/assets/<modid>/textures
, or in any sub-directory thereof.
Geckolib 3
Geckolib 4
- Installation
- Getting Started
- Upgrading from GeckoLib 3.1.x to 4.0
- Updating to GeckoLib 4.5
- Basic
- Advanced
- Miscellaneous
Package repository hosting is graciously provided by Cloudsmith.
Cloudsmith is the only fully hosted, cloud-native, universal package management solution that enables your organization to create, store and share packages in any format, to any place, with total confidence.