-
Notifications
You must be signed in to change notification settings - Fork 0
Building
Requires JDK 25.
git clone https://github.com/the-real-ltcg/key-holder.git
cd key-holder
./gradlew buildThe jar is output to fabric-26.2/build/libs/key-holder-fabric-26.2-<version>.jar.
-
common/— shared platform-agnostic logic (config load/save, hold/toggle state machine). Zero Minecraft dependency, so it stays easy to reuse if another loader is added later. Not a Gradle module; compiled directly into the Fabric jar. -
fabric/— Fabric entrypoint, commands, keybind, Mod Menu config screen, andfabric.mod.jsontemplate. Not a Gradle module. -
fabric-26.2/— the actual buildable Gradle module. Just abuild.gradlepointing its source sets atcommon/andfabric/, plus the MC 26.2 dependency coordinates from the rootgradle.properties.
This mirrors the layout used by afk-chat-spammer,
just with only one loader/version wired up for now — adding a second Minecraft version or loader
later means adding one more build.gradle module pointing at the same shared source, not
duplicating source.
This project uses official Mojang mappings directly (Loom's non-remapping mode for 26.x — Yarn mappings aren't published for 26.2 yet), so class/method names in the source are Mojang's own, not Yarn's. A couple of things that changed recently and are easy to trip over if you're used to older MC versions or Yarn naming:
-
ResourceLocationwas renamed toIdentifier(net.minecraft.resources.Identifier). - Fabric API renamed
KeyBindingHelpertoKeyMappingHelper(net.fabricmc.fabric.api.client.keymapping.v1.KeyMappingHelper).
Key holding itself is done via the vanilla static KeyMapping.set(InputConstants.Key, boolean),
called every client tick while enabled — the same method vanilla uses internally when a real key
press comes in from GLFW.
When in doubt about a class's real API on this Minecraft version, extract the deobfuscated jar
from ~/.gradle/caches/fabric-loom/minecraftMaven/... and run javap -p against it rather than
guessing from docs, which may be stale for a Minecraft version this new.