[1.12.2] how to scale my mob using code?

Started by min03 on Wed, 11/18/2020 - 01:31

Topic category: Help with modding (Java Edition)

Last seen on 12:17, 20. Jan 2021
Joined May 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
[1.12.2] how to scale my mob using code?
Wed, 11/18/2020 - 01:31

i'm trying make my mob bigger and i found how to scale custom mob, 

but it only for custom model.

my mob using vanilla model so i don't  know how to scale my mob

and i'm trying preRenderCallback() method but it doesn't work

also here is code that i found:

(for 1.12.2)

@SideOnly(Side.CLIENT)
     public void registerRenderers() {
          RenderLiving customRender = new RenderLiving<EntityBat>(Minecraft.getMinecraft().getRenderManager(), new mcreator_butterflyMonarch.ModelButterfly(), 0) {
     
     protected ResourceLocation getEntityTexture(EntityBat par1Entity) {
          return new ResourceLocation("t1.png");
     }
     
     protected void preRenderCallback(EntityBat entitylivingbaseIn, float partialTickTime) {
          float f = 1.0F;
         
          GlStateManager.scale(0.2f, 0.2f, 0.2f);
     }    
     
};
          RenderingRegistry.registerEntityRenderingHandler(mcreator_butterflyMonarch.EntitybutterflyMonarch.class, customRender);

     }

and this is my code:

	@SideOnly(Side.CLIENT)
	@Override
	public void preInit(FMLPreInitializationEvent event) {
		RenderingRegistry.registerEntityRenderingHandler(EntityCustom.class, renderManager -> {
			return new RenderLiving(renderManager, new ModelSpider(), 2.5f) {
				protected ResourceLocation getEntityTexture(Entity entity) {
					return new ResourceLocation("spiders:textures/ice_spider.png");
				}
			};
		});
	}

 

 

Last seen on 18:27, 26. Jan 2021
Joined Apr 2010
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I don't think many Java…
Thu, 12/17/2020 - 08:59

I don't think many Java coders are still using 1.12.2 that could help here

Last seen on 05:47, 24. Jan 2021
Joined Nov 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
do something like this: …
Fri, 12/18/2020 - 03:59

do something like this:

@SideOnly(Side.CLIENT)
@Override
public void preInit(FMLPreInitializationEvent event) {
    RenderingRegistry.registerEntityRenderingHandler(EntityCustom.class, renderManager -> {
        return new RenderLiving(renderManager, new ModelSpider(), 2.5f) {
            protected ResourceLocation getEntityTexture(Entity entity) {
                return new ResourceLocation("spiders:textures/ice_spider.png");
            }
            protected void preRenderCallback(EntityLivingBase entityIn, float partialTickTime) {
                GlStateManager.scale(0.2f, 0.2f, 0.2f);
            }
        };
    });
}