@PeriodicSeizures opened this Issue on June 2nd 2021

Overview

I coded a small proof of concept thing for scaffolding and making it look as legit as possible. Using some code from the parkour hack, I created a "Legit" safewalk that almost perfect replicates how speedbridgers are able to crouch right as they reach the edge of a block without walking off. I tested this extensively in a private server, and a few times in the real thing, and the success rate was pretty astonishing. Not once did I fall off the edge.

Implementation

// void doLegitSafeWalk() // or something like that
        KeyBinding sneakKey = WurstClient.MC.options.keySneak;

        // if the sneak key is physically pressed, continuing is redundant
        if(!MC.player.isOnGround() || MC.options.keyJump.isPressed() ||
                ((IKeyBinding)sneakKey).isActallyPressed())
            return;

        Box box = MC.player.getBoundingBox();
        Box adjustedBox = box.offset(0, -0.5, 0).stretch(0, -2.5, 0).expand(-0.25, 0, -0.25);

        Stream<VoxelShape> blockCollisions =
                MC.world.getBlockCollisions(MC.player, adjustedBox);

        // if there is nothing below the player in a smaller box as the edge of block is approached
        if(blockCollisions.findAny().isPresent()) {
            sneakKey.setPressed(((IKeyBinding)sneakKey).isActallyPressed());
            return;
        }

        // then sneak while on the edge
        sneakKey.setPressed(true);

The above code is called through another function from within the update() function (ie doLegitSafeWalk()).

Testing

I tested the actual effectiveness by (where I just inserted the method doLegitSafeWalk() making sure that the old safewalk code wouldn't interfere) walking towards an edge where there is more than a 3 block fall.
Testing scaffolding capabilities by placing a block on the edge, like ordinary crouch bridging (except not actually pressing crouch), then continuing to hold down right click for block placing, is equally fast or faster and more consistent than manually speedbridging, and does not look sketchy at all.

@PeriodicSeizures commented on June 2nd 2021

I didn't realize that this was recently added, that's awesome.

This Issue was closed on June 2nd 2021