Package me.hackware.api
Class MovementManager
java.lang.Object
me.hackware.api.MovementManager
Centralized movement manager — velocity injections, jumps, gravity toggles.
All module-originated velocity mutations and jump triggers go through this manager so they are auditable via the Debug tab's Manager feed.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddVelocity(String caller, double x, double y, double z) Adds to the player's current velocity (push/impulse).static MovementManagerget()voidinit()Register event handlers.voidForces the player to jump from ground (vanilla jump).booleanjumpIfGrounded(String caller) Jumps only if the player is on the ground.voidscaleVelocity(String caller, double xScale, double yScale, double zScale) Scales the player's velocity by the given factors.voidsetHorizontalVelocity(String caller, double x, double z) Sets only the horizontal velocity, preserving the current Y component.voidsetNoGravity(String caller, boolean noGravity) Sets the player's noGravity state.voidsetVelocity(String caller, double x, double y, double z) Overrides the player's velocity entirely.voidsetVelocity(String caller, net.minecraft.world.phys.Vec3 velocity) Overrides the player's velocity entirely.voidsetVerticalVelocity(String caller, double y) Sets only the vertical velocity, preserving horizontal components.
-
Method Details
-
get
-
init
public void init()Register event handlers. Call once during mod init. -
setVelocity
Overrides the player's velocity entirely.- Parameters:
caller- descriptive source (module name or manager)x- x velocityy- y velocityz- z velocity
-
setVelocity
Overrides the player's velocity entirely. -
addVelocity
Adds to the player's current velocity (push/impulse).- Parameters:
caller- descriptive sourcex- x deltay- y deltaz- z delta
-
scaleVelocity
Scales the player's velocity by the given factors.- Parameters:
caller- descriptive sourcexScale- x multiplieryScale- y multiplierzScale- z multiplier
-
setHorizontalVelocity
Sets only the horizontal velocity, preserving the current Y component. -
setVerticalVelocity
Sets only the vertical velocity, preserving horizontal components. -
jump
Forces the player to jump from ground (vanilla jump). -
jumpIfGrounded
Jumps only if the player is on the ground.- Returns:
- true if the jump was executed
-
setNoGravity
Sets the player's noGravity state.
-