Custom Skeleton Mob Renderer

Started by Thermoza on

Topic category: User side tutorials

Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Custom Skeleton Mob Renderer

This is a snippet of my renderer to allow my custom skeleton mob use the skeleton model with the armor rendered. The custom skeleton is called ArmoredSkeleton



package net.mcreator.earthdungeons.client.renderer;



import net.minecraft.resources.ResourceLocation;

import net.minecraft.client.renderer.entity.layers.HumanoidArmorLayer;

import net.minecraft.client.renderer.entity.HumanoidMobRenderer;

import net.minecraft.client.renderer.entity.EntityRendererProvider;

import net.minecraft.client.model.geom.ModelLayers;

import net.minecraft.client.model.SkeletonModel;



import net.mcreator.earthdungeons.entity.ArmoredSkeletonEntity;



public class ArmoredSkeletonRenderer extends HumanoidMobRenderer<ArmoredSkeletonEntity, SkeletonModel<ArmoredSkeletonEntity>> {

    public ArmoredSkeletonRenderer(EntityRendererProvider.Context context) {

        super(context, new SkeletonModel(context.bakeLayer(ModelLayers.SKELETON)), 0.5f);

        this.addLayer(new HumanoidArmorLayer(this, new SkeletonModel(context.bakeLayer(ModelLayers.SKELETON_INNER_ARMOR)),

                new SkeletonModel(context.bakeLayer(ModelLayers.SKELETON_OUTER_ARMOR))));

    }



    @Override

    public ResourceLocation getTextureLocation(ArmoredSkeletonEntity entity) {

        return new ResourceLocation("earth_dungeons:textures/skeleton.png");

    }

}

Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can you do this with a…
Sun, 08/28/2022 - 14:17

Can you do this with a different mob, like say Piglins?

Joined Mar 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How does it work?I'm trying…
Wed, 01/11/2023 - 08:47

How does it work?
I'm trying to replace some things in the code with values from my mod, but it don't work