Skip to main content

Module movement

Module movement 

Source
Expand description

Player movement physics and validation.

This module handles server-side movement simulation and anti-cheat checks. It implements collision detection and physics similar to vanilla Minecraft.

ModulesΒ§

input πŸ”’
Last client input state sent by the player.
state πŸ”’
Movement tracking state for position validation and anti-cheat rate limiting.
teleport πŸ”’
Teleport state tracking for server-side position confirmation.

StructsΒ§

PlayerFloatingValidation πŸ”’
PlayerInput
Vanilla Input snapshot from the latest serverbound player-input packet.

ConstantsΒ§

CLAMP_HORIZONTAL
Horizontal position clamping limit (matches vanilla).
CLAMP_VERTICAL
Vertical position clamping limit (matches vanilla).
DEFAULT_GRAVITY
Default gravity for players (blocks/tickΒ²). Vanilla uses 0.08.
SPEED_THRESHOLD_FLYING
Maximum movement speed threshold for elytra flight (meters per tick squared).
SPEED_THRESHOLD_NORMAL
Maximum movement speed threshold for normal movement (meters per tick squared).

FunctionsΒ§

clamp_horizontal
Clamps a horizontal coordinate to vanilla limits.
clamp_vertical
Clamps a vertical coordinate to vanilla limits.
wrap_degrees πŸ”’