[1.12.2] how to scale my mob using code?

Started by min03 on

Topic category: Help with modding (Java Edition)

Last seen on 08:13, 29. Aug 2021
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[1.12.2] how to scale my mob using code?

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 05:29, 31. Jan 2022
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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);
            }
        };
    });
}

 

Last seen on 07:52, 11. Mar 2024
Joined Mar 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
ok I know this is a pretty…
Thu, 06/03/2021 - 09:52

ok I know this is a pretty old thread but where exactly would I put that code? I have basically no experience with coding especially in java and all I know how to do coding-wise is changing how fast the legs move in walking animations

Last seen on 05:29, 31. Jan 2022
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
edit your custom entity…
Sat, 06/05/2021 - 05:22

edit your custom entity element. find the "public void preInit(FMLPreInitializationEvent event)" line and add the piece of code:

@Override
protected void preRenderCallback(EntityLivingBase entityIn, float partialTickTime) {
    GlStateManager.scale(0.2f, 0.2f, 0.2f);
}

like my code example in my previous post. the 0.2f is the scale, you can change it to whatever scale you like.

remember this is for 1.12.2

Last seen on 16:41, 6. Jun 2023
Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks, but how do we save…
Wed, 03/29/2023 - 00:02

Thanks, but how do we save the code? Because whenever I try to to it the scale of the mob resets itself.

Last seen on 16:41, 6. Jun 2023
Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If I don't lock the code I…
Wed, 03/29/2023 - 00:52

If I don't lock the code I get an error screen.