Posted May 8, 20205 yr 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?
May 9, 20205 yr 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.
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.