Search code examples
minecraftminecraft-fabric

How does "Meteor Client"(Minecraft cheat) allows to decrease fps to 1?


I have tried looking at google, but couldn't find a definite answer on this question. "How does limit the fps to 1?". When it's by default only possible to do it only for 10.


Solution

  • They basically modify Minecraft’s code on the game startup using a fabric mixin into the getFramerateLimit() function of net.minecraft.client.MinecraftClient to tell Minecraft to go to any value they set.

    Here is the code snippet that controls this logic:

    MinecraftClientMixin.java:

    @Inject(method = "getFramerateLimit", at = @At("HEAD"), cancellable = true)
        private void onGetFramerateLimit(CallbackInfoReturnable<Integer> info) {
            if (Modules.get().isActive(UnfocusedCPU.class) && !isWindowFocused()) info.setReturnValue(Math.min(Modules.get().get(UnfocusedCPU.class).fps.get(), this.options.getMaxFps().getValue()));
        }
    

    All it does is inject into the class, check if the module is active and sets the value to Modules.get().get(UnfocusedCPU.class).fps.get() which is whatever you set in the client menu (ex. 1, 10, 14, etc...)