ttgetdunkedon

make a mod that turns analog movement from controllers to digital movement

Kodari AI
KodariApr 19 at 3:57 am 8,092 (v2)
DigitalMovement
Converts analog stick input from controllers into digital (binary) movement, making the player move at full speed or not at all — no in-between. This eliminates the gradual acceleration from analog sticks, giving controller users the same crisp, instant full-speed movement as keyboard players. Works by intercepting movement input vectors and snapping them to cardinal/diagonal directions at full magnitude.
DigitalMovement
Converts analog stick input from controllers into digital (binary) movement, making the player move at full speed or not at all. Intercepts the movement input vector each tick and snaps forward/sideways values to -1, 0, or 1, eliminating analog gradients. Gives controller users the same crisp, instant full-speed movement as keyboard players. Purely client-side with no server component required.

Now I’ll build the mod. The plan:

  • Mixin into net.minecraft.client.input.Input after tick() to snap movementForward and movementSideways to digital values

  • Client-only mod using split source sets

  • No items/blocks/registry needed — pure input interception

The mod injects into Input.tick() after it runs each frame, reading movementForward and movementSideways (the values controller mods write analog stick data into) and snapping them through a deadzone (±0.1) to exactly -1, 0, or 1 — giving controller users instant full-speed digital movement identical to keyboard input.

ttgetdunkedon

can you make it compatible with version 1.21.11?

Kodari AI
KodariApr 19 at 4:12 am 6,886 (v2)

1.21.11 doesn’t exist — I’ll assume you mean 1.21.1. The key differences are the yarn mappings, Fabric API version, and the Input.tick() signature (it takes boolean, float parameters in 1.21.1, not no-args).

Three things need updating for 1.21.1:

  • gradle.properties — yarn mappings, Fabric API version, loom version

  • fabric.mod.json — minecraft version constraint

  • InputMixin.java — in 1.21.1 Input.tick() takes (boolean sneaking, float slowdownFactor) parameters, so the descriptor and handler signature must match

Three files updated:

  • gradle.properties — switched to 1.21.1 yarn mappings (1.21.1+build.3), Fabric API (0.100.8+1.21.1), and loom 1.7.4

  • fabric.mod.json — version constraint changed to ~1.21.1

  • InputMixin.java — descriptor updated from tick()V to tick(ZF)V with matching boolean sneaking, float slowdownFactor parameters before CallbackInfo, matching 1.21.1’s Input.tick(boolean, float) signature

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
8 132
src/main/java/com/example/digitalmove/DigitalMovement.java
package com.example.digitalmove;

import net.fabricmc.api.ModInitializer;

public class DigitalMovement implements ModInitializer {
    public static final String MOD_ID = "digitalmove";

    @Override
    public void onInitialize() {
    }
}