Skip to main content

PhysicsState

Type Alias PhysicsState 

Source
pub type PhysicsState = ClientMovementState;
👎Deprecated:

renamed to ClientMovementState.

Aliased Type§

pub struct PhysicsState {
    pub position_remainder: u32,
    pub was_sprinting: bool,
    pub trying_to_sprint: bool,
    pub trying_to_crouch: bool,
    pub move_direction: WalkDirection,
    pub move_vector: Vec2,
}

Fields§

§position_remainder: u32

Minecraft only sends a movement packet either after 20 ticks or if the player moved enough. This is that tick counter.

§was_sprinting: bool§trying_to_sprint: bool§trying_to_crouch: bool

Whether our player is currently trying to sneak.

This is distinct from AbstractEntityShiftKeyDown, which is a metadata value that is controlled by the server and affects how the nametags of other entities are displayed.

To check whether we’re actually sneaking, you can check the Crouching or Pose components.

§move_direction: WalkDirection§move_vector: Vec2