FabricMC / fabric

Essential hooks for modding with Fabric.
Apache License 2.0
2.3k stars 405 forks source link

Hook for modifying player movement during item use #4103

Open haykam821 opened 1 week ago

haykam821 commented 1 week ago

Having the ability to modify player movement for items currently being used would be useful, as the current ClientPlayerEntity injection point is quite annoying and fickle to target:

public void tickMovement() {
    // etc

    if (this.isUsingItem() && !this.hasVehicle()) {
        this.input.movementSideways *= 0.2F;
        this.input.movementForward *= 0.2F;
        this.ticksLeftToDoubleTapSprint = 0;
    }

    // etc
}

For example, a mod may wish to adjust or disable the slowdown when a player is using the mod's custom bow.

fishshi commented 1 week ago

I‘m working on it