Posted August 22, 20232 yr This is a very specific problem, but let me elaborate: I am implementing a custom GeckoLib entity that is a sticky bomb. When thrown at another entity, the bomb must latch onto that entity by "riding" it. I need to do mainly two things in order to make the bomb really look like it is sticking to an entity: 1. Modify the bomb's riding position by overriding its Entity#setPos method. The bomb must be positioned so that it will appear stuck to the body part of the entity that it hit. 2. Modify the bomb's rotation by overriding its Projectile#updateRotation method. The bomb should be rotated so that it constantly faces its victim (i.e. the center of the victim's hitbox). The math and logic behind implementing #1 and #2 was not that difficult for me, and I was able to implement #1 successfully. However, I am struggling with #2 because whenever the vehicle itself rotates, the bomb seems to rotate the wrong way. I even tried modifying the overridden updateRotation method so that the bomb's rotation is not changed when it is riding a vehicle (i.e. this.getVehicle() != null), but the bomb somehow still rotates when the vehicle rotates. So far, I could not find any other code that modifies the rotation of a passenger entity on a vehicle. But what I have found out is that--when the bomb rotates unexpectedly--its hitbox does not rotate with it (Hitbox rotation is indicated by the direction its blue line is pointing when the player presses F3 + B). Was it being rotated clientside? What could be causing this behavior? Edited September 6, 20232 yr by LeeCrafts
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.