public static MeshDefinition createBodyLayer() {
var mesh = new MeshDefinition();
var partdefinition = mesh.getRoot();
... model code
return mesh;
}
ResourceLocation name = !!!model name!!! ;
ModelLayerLocation modelLayerLocation = ModModelLayers.make(name.getPath(),"main");
modelconsumer.accept(modelLayerLocation, () -> LayerDefinition.create(!!! createBodyLayer() !!!, texW, texH));
ModModelLayers.layers.put(name,modelLayerLocation);