Jump to content

[1.18.2] Dynamically change custom mob size depending on age in ticks.


Kangalia

Recommended Posts

Hello. I've made a custom mob with Geckolib, which works fine. However, I want this mob to grow dynamically as it ages, rather than just popping into its adult appearance like vanilla mobs. I've managed to get this working somewhat, but there are a few problems:

  • The mob still grows when the singleplayer client is paused.
  • The mob only grows if it's on screen; if it's, say, behind the player, then it will never grow.

Now I know these issues are caused by putting the growth code in the render method in my mob's renderer, but I have no idea where else I should put it. After doing some research, I found I should be using the scale method, but as I'm using a GeckoLib renderer (GeoEntityRenderer<>), this method does not exist for me. If anyone has any ideas in how I could either work around this issue, or some other way of solving this, that would be great.

Cheers!

  • Like 1
Link to comment
Share on other sites

Thank you for the quick reply! I've moved the growth code into the tick method and made that update a field I've saved with EntityDataAccessors. However, if I try and update the size in the render method using this, the entire model rendering breaks. The entity has no hitbox, cannot be pushed, and when it's killed, it remains in the world. Am I missing something?

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.