Copy-Paste Templates
Just looking for some template code to copy-paste?
See below for some existing code you can use to get you started.
warning
The below examples are targeted at replacing a vanilla Creeper.
Lines have been highlighted in green to show you where you will need to replace code for your own target entity
GeoReplacedEntity Class
public class ExampleReplacedEntity implements GeoReplacedEntity {
private final AnimatableInstanceCache geoCache = GeckoLibUtil.createInstanceCache(this);
@Override
public EntityType<?> getReplacingEntityType() {
return EntityType.CREEPER;
}
@Override
public void registerControllers(final AnimatableManager.ControllerRegistrar controllers) {
}
@Override
public AnimatableInstanceCache getAnimatableInstanceCache() {
return this.geoCache;
}
}
GeoModel
public class ExampleReplacedEntityGeoModel extends DefaultedEntityGeoModel<ExampleReplacedEntity> {
public ExampleReplacedEntityGeoModel() {
super(Identifier.fromNamespaceAndPath(ExampleMod.MOD_ID, "example_replaced_entity"));
}
}
Entity Renderer
public class ExampleReplacedEntityRenderer<R extends CreeperRenderState & GeoRenderState> extends GeoEntityRenderer<ExampleReplacedEntity, Creeper, R> {
public ExampleReplacedEntityRenderer(EntityRendererProvider.Context context) {
super(context, new ExampleReplacedEntityGeoModel(), new ExampleReplacedEntity();
}
}