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

Hi everyone, quick request:

 

I've got a file which we'll call 'ExtendMob' and each EntityLiving gets turned into an ExtendMob object aside from the player. This all works fine, and so I'm trying to change the scaling of the mob's model. I know this can be achieved by all the new model stuff added by 1.8, but that's not what I need.

 

So after looking over the different vanilla files, trying to figure out how the GiantZombie scales, I found the variables 'width' and 'height'; after changing such in a quick experiment I learned that that only has an effect on the bounding box, not the actual model. And then I saw the GiantZombie class uses the 'setSize' method, but to me demise it was protected. Then I embarked on using reflection to invoke the method, and after finally getting it to work, I simply learned that it does the exact same thing as just changing width and height.

 

Is there any way of changing the mob's model scaling in the code, not the asset files?

 

Would I maybe need to do some GL11 wizardry?

As you partially discovered, the width, height and also the setSize() only affect the bounding box.

 

For scaling the model, you do that in your model file for the entity. In the render method that is called, you add a G11 scale operation.

 

Note though that you may have to do a translation before and after the scaling, otherwise the "feet" of the entity will go into the ground. Basically what you need to do is:

 

1) G11 translate downwards by the distance your origin of the model is above the ground.

2) G11 scale

3) G11 translate upwards by the distance from Step #1 times the amount you scaled the model.

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

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.