Skip to main content

move_entity

Function move_entity 

Source
pub(crate) fn move_entity(
    state: &EntityPhysicsState,
    delta: DVec3,
    mover_type: MoverType,
    world: &dyn CollisionWorld,
) -> MoveResult
Expand description

Moves an entity through the world with collision detection and resolution.

This is the main physics function that implements vanilla’s Entity.move() behavior, including step-up mechanics and sneak-edge prevention.

§Arguments

  • state - The entity’s current physics state
  • delta - The desired movement vector (velocity * dt)
  • mover_type - Type of movement being performed
  • world - World collision provider

§Returns

A MoveResult containing the final position and collision information.

§Vanilla Reference

net.minecraft.world.entity.Entity.move(MoverType, Vec3)