Skip to content

Fix: use distance from boundbox edge for targeting distance#267

Open
TwinkNet wants to merge 5 commits intolambda-client:1.21.11from
TwinkNet:TwinkNet/Targeting-Distance
Open

Fix: use distance from boundbox edge for targeting distance#267
TwinkNet wants to merge 5 commits intolambda-client:1.21.11from
TwinkNet:TwinkNet/Targeting-Distance

Conversation

@TwinkNet
Copy link
Contributor

Currently Lambda uses the Entity.pos to calculate distance from the player, which results in inconsistent targeting when fighting entities with large hitboxes, such as big slimes, ender dragons, and withers. I keep my targeting distance set to 3 blocks and there are certain mobs that it just won't hit unless i'm kissing them.

This PR adds a helper function for calculating the distance from a Vec3d to the closest side of a Box, and uses that function in WorldUtils.internalGetFastEntities() to calculate distance.

Additionally, fastEntitySearch() now accepts a FastVector rather than a BlockPos, as I found that this helps achieve a bit more consistency in targeting when standing on the edge of a block.

@cattyngmd
Copy link
Contributor

cattyngmd commented Mar 13, 2026

you need to account for AABB epsilon when calculating distance to closest AABB edge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

3 participants