Swift Sneak enchantment not working - XInput Logitech F310
andrewaramsay opened this issue ยท 2 comments
Describe the bug
When using the controller to move, the new Swift Sneak enchantment seems to have no effect. When switching to keyboard input, the increase speed is noticed.
To Reproduce
Steps to reproduce the behavior:
- Enchant a pair of leggings with Swift Sneak III
- Sneak (toggle)
- Walk around
- Use minihud or comparable mod to measure speed, or just compare to keyboard movement, it's pretty noticeable.
Expected behavior
A movement speed close to walking speed (3.2 m/s in minihud)
Actual behavior
Movement speed is halved identical to sneak speed without the enchantment (1.2 m/s in minihud)
Desktop (please complete the following information):
OS: Windows
Minecraft 1.19
Fabric 0.14.8
Mods:
-- automated-craftnig 1.4.6+MC1.19
-- balm-fabric 4.3.0
-- cloth-config 7.0.72
-- fabric-api 0.56.3+1.19
-- journeymap 1.19-5.8.frc1-fabric
-- lithium-fabric mc1.19-0.8.0
-- malilib-fabric-1.19-0.12.1
-- midnightcontrols 1.3.0+1.19
-- minihud-fabric-1.19-0.22.0
-- phosphor-fabric mc1.19.x-0.8.1
-- sodium-fabric mc1.19-0.4.2+build.16
-- waystones-fabric-1.19-11.0.1
-- worldedit 7.2.11-beta-01
Version 1.3.0+1.19
Additional context
This appears to be happening both with analog movement enabled or disabled. We've tried adjusting the left stick max values with no change. We're using a Logitech F310, and both XInput and Direct Input both have the same problem. I also tried binding the Forward action to a non-analog input (d-pad button) in case that had anything to do with it, but it still seemed to not work.
I'm not super familiar with the PR process or minecraft mod dev in general (versioning, forking, releases, etc.). But in case it helps, I was able to fix this locally by updating
MovementHandler (and sideways movement on line 93) with the following line
MathHelper.clamp(0.3F + EnchantmentHelper.getSwiftSneakSpeedBoost(client.player), 0.0F, 1.0F)