Skip to main content

Module physics

Module physics 

Source
Expand description

Physics engine for entity movement with vanilla Minecraft parity.

This module implements the core physics simulation for moving entities through the world with proper collision detection, including:

  • Step-up mechanics (climbing blocks ≤ max_up_step height)
  • Sneak-edge prevention (staying on block edges while crouching)
  • VoxelShape-based collision using AABB lists

The implementation closely follows vanilla’s Entity.move() method to ensure 1:1 movement validation for anti-cheat purposes.

Re-exports§

pub use collision::CollisionWorld;
pub use collision::WorldCollisionProvider;
pub use collision::has_block_collision;
pub use collision::has_collision;
pub use collision::is_colliding_with_new_shapes;
pub use movement_validation::MOVEMENT_ERROR_THRESHOLD;
pub use movement_validation::MovementCollisionValidation;
pub use movement_validation::movement_error_delta;
pub use shapes::collide;
pub use shapes::join_is_not_empty;
pub use shapes::merged_face_occludes;
pub use shapes::translate_shape;

Modules§

collision
World collision queries for physics simulation.
entity_move 🔒
Entity movement physics with vanilla parity.
movement_validation
Shared vanilla movement-validation helpers for client-authored movement.
physics_state 🔒
Entity physics state representation.
shapes
VoxelShape collision operations.

Structs§

MoveResult
Result of a movement operation.

Enums§

MoverType
Type of movement being performed.

Constants§

COLLISION_EPSILON
Collision epsilon used for AABB deflation (vanilla constant).