Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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();
						
    		    }

 

  • Author

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();
		}

 

  • Author
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

  • Author
17 minutes ago, poopoodice said:

if ur entity extends AgeableEntity yes they grow : )

lol yeah they do i just waited 15-20min and it grow i was so happy :D

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.