Started by
maxhaaa
on
Topic category: Help with MCreator software
so, i got a bit frustrated on why villagers/witches do not hold items when using the built in models from mcreator. after digging in the vannila code for minecraft and comparing the original villager code with whats generated. i found that its missing its crossedarmhandlayer which bassicly designates a entity to hold items like a villager. you can do this in the ENTITY RENDERER. hopfully mcreator add's this VERY simple fix so they can add villagers and witches to their models that can hold items
I FIXED IT WITH 2 LINES THAT ANYONE CAN JUST COPY AND PASTE IN
for anyone coming back to this, this is how you do it
this import goes with the rest just at top
import net.minecraft.client.renderer.entity.layers.CrossedArmsItemLayer;
this one goes JUST after your super in the public class - copy the line below this
this.addLayer(new CrossedArmsItemLayer<>(this, context.getItemInHandRenderer()));
example from my mod on where to put it. IT SHOULD GENERATE ALL THAT OTHER STUFF, IT WONT GENERATE WHAT YOUR PUTTING IN
public class VillagersoldierRenderer extends MobRenderer<VillagersoldierEntity, VillagerModel<VillagersoldierEntity>> {
public VillagersoldierRenderer(EntityRendererProvider.Context context) {
super(context, new VillagerModel<VillagersoldierEntity>(context.bakeLayer(ModelLayers.VILLAGER)), 0.5f);
this.addLayer(new CrossedArmsItemLayer<>(this, context.getItemInHandRenderer()));
}