Posted May 11, 20187 yr I am trying to make a very long but thin entity. If I use the standard axis aligned bounding boxes, the box is very inaccurate if the entity rotates. I saw that minecraft uses multiple entities for the ender dragon. Is there another way to fix my problem because I would need a lot of sub entities and the box would probably still be inaccurate. Can I sub class AxisAlignedBB somehow without creating compatibility issues?
May 11, 20187 yr No, the bounding box is always a square base and doesn't rotate. This is because it greatly simplifies pathfinding and collision checking and so is important for performance reasons. So for any unusually shaped bounding box you'll need to create some additional invisible "hitbox entities". You don't need to break your actual entity into different parts, you just need to place the invisible entities in the right places (that will still take some math to get right since you'll probably want to consider rotation). If the hitbox entity gets hit then you notify the parent entity and perform the intended action. Definitely a pain, but also definitely possible to achieve with a bit of thought. 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.