Repository navigation
fix(place): drop reach-around placement, click only where the ray hits - #64
Merged
notchyves merged 1 commit intoNov 6, 2026
Merged
Conversation
The reach-around assist placed against the block under the player when the look ray hit nothing, and made up a click on that block's edge (y 0.999). The vanilla client takes the build click from its HitResult only, so these clicks did not match the player's view and got flagged as scaffolding. Keeps the held-build tests as heldbuild_selftest.
notchyves
pushed a commit
that referenced
this pull request
Nov 6, 2026
… edge (#72) Bedrock bridging works by looking down past the edge of the block you stand on: the ray hits nothing, yet the game targets that block. #64 removed Perlin's invented reach-around (and its made-up click), which left no way to place there at all. The game's pick (0x144E090C0) does it when nothing is in reach and the look direction's y is below -0.7: it clips blocks from the eye 2 blocks straight down, keeps that hit point, and sets the face from the look's dominant horizontal axis; the hit carries a flag (+0x84) that held repeats check before reusing it (0x14376B8D0). Perlin now does the same, so the outline shows and the click is mPos - BlockPos (top of the block) like the game's.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
About 27 seconds into a Solo SkyWars game on CubeCraft, the account was temp-banned: "Unfair Advantage (Sentinel Automatic Cheat Detection)". A packet capture of the whole game (Perlin's
packetlog) shows the player bridging during the 10 seconds before thedisconnect.For every
InventoryTransaction/UseItemOnsent in the game, I rebuilt the look ray from the eye position and the yaw/pitch of the precedingPlayerAuthInput. I then measured the angle between that ray and the point the transaction claims was clicked (blockPosition + clickPos):[0.977, 0.855, 0.735][0.023, 0.356, 0.402][0, 0.999, 0.523][0, 0.999, 0.494][0.305, 1, 0.473][0, 0.999, 0.425][0, 0.999, 0.39][0, 0.999, 0.352][0, 0.999, 0.337][0, 0.999, 0.312][1, 0.04, 0.23][0.164, 1, 0.234][0.773, 1, 0.251][1, 0.563, 0.257][0.07, 1, 0.26]disconnect: temp banRows with a real ray hit are within about 1° (float rounding, plus the 50 ms between input and transaction). The suspicious run (21:53:35 → 21:53:41) is different on two counts:
clickPos.y = 0.999every time: the click is pinned to the top edge of the block's side;That is the reach-around assist (
Bridging::FindTarget). When the look ray hits nothing, it picks the block under the player, projects the ray onto it and clamps the point to that block's edge (clickY→0.999). The client then sends a click the player's view never reached, on every block of the bridge. To an anticheat, that is scaffolding.What the vanilla client sends
The behaviour below comes from IDA on the Windows client 1.26.60.5. The build lambda is
0x143771570, called fromGameModevtable slot 6 (0x14376B290), which builds theItemUseInventoryTransaction. It reads the player'sHitResultthroughlevel->vfunc(2680), with the type at+24and face /BlockPos/mPosat+28..+56:+252HitResult::mPos - BlockPos: the real ray hit on the faceENTITY_OUT_OF_RANGE/ 3NO_HIT)BlockPos - BlockPos=(0, 0, 0)GameMode+65set and0x145E90D10(player))GameMode+108on the first placementNone of these produces an edge-clamped click that the look ray does not reach. No string or code path for a placement assist exists in the client.
Change
PerlinInteraction.cpp: the reach-around block is removed. A fresh press places only on the crosshair block, with the click taken from the ray hit (clickOf:point - block).Bridging.{hpp,cpp}are deleted, since they had no other user.tests/bridging_selftest.cpp→tests/heldbuild_selftest.cpp: the reach-around cases are dropped, and everyHeldBuild/BlockUsecheck is kept (held repeat delays, build line, body overlap, slab/stair rules).docs/bedrock-bridging.mdanddocs/bedrock-native-placement.md: document the vanilla click rules above.Held repeats (
HeldBuild, ported from_tickBuildAction/continueBuildBlock) are unchanged. Two things there still need checking against the table:(0, 0, 0)), as vanilla does;GameMode+108). That needs its own follow-up.Testing
heldbuild_selftestwere still running when this PR was opened, so the code has not been compiled or run yet.UseItemOnstays on the look ray.