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

GL11 has a function called scale, you can just render the model you want to shrink and just call the scale function before the render method to make it bigger/smaller

"you seem to be THE best modder I've seen imo."

~spynathan

 

ლ(́◉◞౪◟◉‵ლ

You have to be a bit careful though, because the scale will scale around the origin of entity model which happens to be at 1.5 blocks above the ground. If you just scale it bigger then the bottom of your entity will go into the ground, and if you just scale it smaller then the bottom of your entity will not touch the ground.

 

So you need to translate the model, then scale it. I've worked out the formula. You just need to push a transformation matrix then translate and scale (and don't forget to pop the matrix at the end). So like this:

 

public void render(Entity parEntity, float par2, float par3, float par4, float par5, float par6, float par7)

{

        setRotationAngles(parEntity, par2, par3, par4, par5, par6, par7, parEntity);

 

        // scale the whole thing for big or small entities

        GL11.glPushMatrix();

        GL11.glTranslatef(0F, 1.5F-1.5F*parEntity.getScaleFactor(), 0F);

    GL11.glScalef(parEntity.getScaleFactor(), parEntity.getScaleFactor(), parEntity.getScaleFactor());

 

        myModel.render(par7);

 

        // don't forget to pop the matrix for overall scaling

        GL11.glPopMatrix();

  }

 

You would substitute your scale factor and model of course for you your entity.

 

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

  • Author

I tried to add the code you specified, jabelar, to the render() method of ModelSpider.java, but I get the error "The method getScaleFactor() is unidentified for the Type Entity."

 

Here is what I have for render():

 

public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_)

{

this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_);

 

// scale the whole thing for big or small entities

GL11.glPushMatrix();

GL11.glTranslatef(0F, 1.5F-1.5F*p_78088_1_.getScaleFactor(), 0F);

GL11.glScalef(p_78088_1_.getScaleFactor(), p_78088_1_.getScaleFactor(), p_78088_1_.getScaleFactor());

 

this.spiderHead.render(p_78088_7_);

this.spiderNeck.render(p_78088_7_);

this.spiderBody.render(p_78088_7_);

this.spiderLeg1.render(p_78088_7_);

this.spiderLeg2.render(p_78088_7_);

this.spiderLeg3.render(p_78088_7_);

this.spiderLeg4.render(p_78088_7_);

this.spiderLeg5.render(p_78088_7_);

this.spiderLeg6.render(p_78088_7_);

this.spiderLeg7.render(p_78088_7_);

this.spiderLeg8.render(p_78088_7_);

 

// don't forget to pop the matrix for overall scaling

GL11.glPopMatrix();

}

You would substitute your scale factor and model of course for you your entity.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

  • Author

You would substitute your scale factor and model of course for you your entity.

 

I'm sorry if I'm missing something obvious, but I'm still new to modding.

Could you tell me what I'm doing wrong or what exactly it means to substitute the scale factor and model for my entity, if I didn't do that correctly?

In Jabelar's example, he uses

Entity#getScaleFactor()

. In his own code, where he uses that, he probably casts the

Entity

parameter to his own

Entity

, which has the

getScaleFactor()

method. Now, you need to substitute the

getScaleFactor()

for your own way of getting the scale. You can either harcode it, or use a method in your own

Entity

.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

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.