Posted June 14, 20205 yr 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(); }
June 15, 20205 yr 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(); }
June 16, 20205 yr 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
June 16, 20205 yr Author no wait now im not sure but i think he just turned into an adult lol im confused
June 16, 20205 yr if ur entity extends AgeableEntity yes they grow : ) Edited June 16, 20205 yr by poopoodice
June 16, 20205 yr 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
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.