make a mod that turns analog movement from controllers to digital movement
Now I’ll build the mod. The plan:
Mixin into
net.minecraft.client.input.Inputaftertick()to snapmovementForwardandmovementSidewaysto digital valuesClient-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.
can you make it compatible with version 1.21.11?
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 versionfabric.mod.json— minecraft version constraintInputMixin.java— in 1.21.1Input.tick()takes(boolean sneaking, float slowdownFactor)parameters, so the descriptor and handler signature must match
Three files updated:
gradle.properties— switched to1.21.1yarn mappings (1.21.1+build.3), Fabric API (0.100.8+1.21.1), and loom1.7.4fabric.mod.json— version constraint changed to~1.21.1InputMixin.java— descriptor updated fromtick()Vtotick(ZF)Vwith matchingboolean sneaking, float slowdownFactorparameters beforeCallbackInfo, matching 1.21.1’sInput.tick(boolean, float)signature
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() {
}
}