Use Keybindings to assign keys.
Most useful examples:
teleport.toCrosshair(20); - teleport toward crosshair, up to 20 blocks. Packet count is automatic.
teleport.toCrosshair(20, 5); - same, but send exactly 5 MovePlayer packets.
teleport.vertical(-50); - teleport up to 50 blocks down. Use positive values to go up.
teleport.vertical(-50, 5); - same, but send exactly 5 MovePlayer packets.
teleport.vertical(-1, -50, true); - search downward for empty space with a block below your feet.
Crosshair teleport
If your crosshair hits a block, your feet are placed at the hit location, similar to an ender pearl. Blocks without collision, such as grass or flowers, are ignored by the raycast. If you aim at the sky, the target is the point at the specified distance in your view direction. Free Cam position and view direction are used when Free Cam is enabled.
Vertical teleport
teleport.vertical(distance) tries to teleport by that Y distance. Negative values go down, positive values go up. If the exact destination is not valid, it backs off toward you until it finds a valid position.
Vertical range search
teleport.vertical(fromDistance, toDistance, findSurface) searches from one vertical offset to another. Example: teleport.vertical(-1, -50, true); starts 1 block below you and searches down to 50 blocks below you. If findSurface is true, the target must have a block below your feet. You can swap the range, for example teleport.vertical(-50, -1, true);, to search in the opposite direction.
Packet parameter
Methods with a packets parameter send that many MovePlayer packets, including the final position packet. Values less than 1 still send one final position packet. These values are not clamped, so you can experiment with different servers.
Automatic packet count
Methods without a packets parameter estimate packet count from vanilla movement checks. Vanilla does not simply reject more than 5 movement packets in one server tick. Instead, up to 5 packets can increase the allowed movement budget; after that, vanilla stops giving extra budget. Automatic mode therefore backs off to a closer valid target if a teleport would need more than 5 packets.
Return value
All methods return true only when a teleport packet was sent. They return false if the distance is invalid, no player/world exists, no valid position is found, or vanilla-style movement validation predicts the server would reject the movement.