Jump to content

1.15 Baby Mob Size


ninjawizard

Recommended Posts

Hey guys im trying to make my mobs breed smaller babies, i got 2 codes here, they give no errors but they wont scale it, can someone help?

 

 protected void preRenderCallback(MatrixStack ms, AgeableEntity entitylivingbaseIn, float f, float partialTickTime) {
          			float scale = 0.8f;
          			if (entitylivingbaseIn.getGrowingAge() < 0) {
               			f = (float)((double)f * 0.5D);
               			this.shadowSize = 0.4F; 
          			} else { 
          				this.shadowSize = 0.8F;
          			}
          			
						ms.push();
						ms.translate(0F, -0.5F, 0F); // translation
						ms.scale(scale, scale, scale);
						ms.pop();
						
    		    }

 

protected void preRenderCallback(MatrixStack ms, AgeableEntity entitylivingbaseIn, float f, float partialTickTime) {
          			//float scale = 0.8f;
          			if (entitylivingbaseIn.getGrowingAge() < 0) {
               			ms.push();
						ms.translate(0F, -0.5F, 0F); // translation
						ms.scale(0.4F, 0.4F, 0.4F);
               			this.shadowSize = 0.4F; 
          			} else {
          				ms.push();
						ms.translate(0F, -0.5F, 0F); // translation
						ms.scale(0.8F, 0.8F, 0.8F); 
          				this.shadowSize = 0.8F;
          			}
          			
						
						ms.pop();
						
    		    }

 

Link to comment
Share on other sites

Or Maybe i could change something here, where i Scale the Mob (on the model file)

 

public void render(MatrixStack ms, IVertexBuilder vb, int i1, int i2, float f1, float f2, float f3, float f4) {

			ms.push();
			ms.scale(0.8f, 0.8f, 0.8f);
			ms.translate(0F, 0.38F, 0F); // translation
			//ms.rotate(Vector3f.YP.rotationDegrees(180.0F)); //rotation
		
			Head.render(ms, vb, i1, i2, f1, f2, f3, f4);
			
		   ............
			
			ms.pop();
		}

 

Link to comment
Share on other sites

25 minutes ago, [NoOneButNo] said:

I suggest reading the ZombieEntity class and its renderer.

i will!

i manage to scale down my baby mobs with this code:

 

public void render(MatrixStack ms, IVertexBuilder vb, int i1, int i2, float f1, float f2, float f3, float f4) {

			ms.push();
			
			if (this.isChild) {
			ms.scale(0.4f, 0.4f, 0.4f);
			ms.translate(0F, 1.2F, 0F); // translation	
			} else {
			ms.scale(0.8f, 0.8f, 0.8f);
			ms.translate(0F, 0.38F, 0F); // translation	
			}
			
			
			//ms.rotate(Vector3f.YP.rotationDegrees(180.0F)); //rotation
		
			Head.render(ms, vb, i1, i2, f1, f2, f3, f4);
			...
			Nose.render(ms, vb, i1, i2, f1, f2, f3, f4);
			
			ms.pop();
		}

it works but the baby wont grow lol, i need to add more code for that right?

 

thank you very much for helping me

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.