Advertisement
Guest User

CustomEntityRenderer.java

a guest
Jun 21st, 2023
917
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.95 KB | None | 0 0
  1. ====================
  2. Replace this:
  3. ====================
  4.  
  5. public class CustomEntityRenderer extends HumanoidMobRenderer<CustomEntity, HumanoidModel<CustomEntity>> {
  6.     public CustomEntityRenderer(EntityRendererProvider.Context context) {
  7.         super(context, new HumanoidModel(context.bakeLayer(ModelLayers.PLAYER)), 0.5f);
  8.         this.addLayer(new HumanoidArmorLayer(this, new HumanoidModel(context.bakeLayer(ModelLayers.PLAYER_INNER_ARMOR)), new HumanoidModel(context.bakeLayer(ModelLayers.PLAYER_OUTER_ARMOR)), context.getModelManager()));
  9.     }
  10.  
  11.     @Override
  12.     public ResourceLocation getTextureLocation(CustomEntity entity) {
  13.         return new ResourceLocation("textures/entity/skeleton/skeleton.png");
  14.     }
  15. }
  16.  
  17.  
  18. ====================
  19. With:
  20. ====================
  21.  
  22.  
  23.  
  24. public class CustomEntityRenderer extends HumanoidMobRenderer<CustomEntity, SkeletonModel<CustomEntity>> {
  25.     private static final ResourceLocation SKELETON_LOCATION = new ResourceLocation("textures/entity/skeleton/skeleton.png");
  26.  
  27.     public CustomEntityRenderer(EntityRendererProvider.Context context) {
  28.         this(context, ModelLayers.SKELETON, ModelLayers.SKELETON_INNER_ARMOR, ModelLayers.SKELETON_OUTER_ARMOR);
  29.     }
  30.  
  31.     public CustomEntityRenderer(EntityRendererProvider.Context p_174382_, ModelLayerLocation p_174383_, ModelLayerLocation p_174384_, ModelLayerLocation p_174385_) {
  32.         super(p_174382_, new SkeletonModel<>(p_174382_.bakeLayer(p_174383_)), 0.5F);
  33.         this.addLayer(new HumanoidArmorLayer<>(this, new SkeletonModel(p_174382_.bakeLayer(p_174384_)), new SkeletonModel(p_174382_.bakeLayer(p_174385_)), p_174382_.getModelManager()));
  34.     }
  35.  
  36.     @Override
  37.     public ResourceLocation getTextureLocation(CustomEntity p_114482_) {
  38.         return SKELETON_LOCATION;
  39.     }
  40.  
  41.  
  42.  
  43. -------------------------------------------------------
  44.  
  45. IMPORTANT! Replace "modnamespace" with your modnamespace which is your mod id, lowercase. If you aren't sure, you can go to your Workspace settings.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement