Jump to content

Recommended Posts

Posted

Hi !
I designed two models for my entity, and I would want to change the model depending of either the entity is moving or not. But I have no idea how to do so, does someone know how to, or know a mod that do that?

Posted

Combine the two models into a single model. Create some parameter that checks whether the entity is moving. A simple DataParameter<Boolean> should do the trick nicely. You could also check the velocity of the entity depending on if the entity Set the value to true whenever the entity is moving and false when it is not. Override preRenderCallBack in your EntityRenderer and have your ModelRenderer#showModel value switch whenever the player is moving or not. You should probably keep a cached value inside the renderer so that you do not call the change every frame as that would be redundant.

  • Thanks 1

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.