InvMove module

InvMove: Minecraft 26.3 cheat module, full source for every implementation (1 client: KiwiClient).

1 implementationMOVEMENT

Clients with this module

Full module source: 1 implementation

Every implementation below is the complete module file, verbatim. Expand a client to read its code.

KiwiClientMOVEMENTsrc/main/java/com/tangykiwi/kiwiclient/module/movement/InvMove.javaJava · 64 lines · 2.8 KB

Lets you move while in inventories

SettingsSneakJump
InvMove.javaJava · Minecraft 26.2 · 64 lines · 2.8 KB · complete file, verbatimOriginal ↗
1
package com.tangykiwi.kiwiclient.module.movement;
2
3
import static com.tangykiwi.kiwiclient.KiwiClient.mc;
4
5
import com.google.common.eventbus.Subscribe;
6
import com.mojang.blaze3d.platform.InputConstants;
7
import com.tangykiwi.kiwiclient.event.TickEvent;
8
import com.tangykiwi.kiwiclient.mixin.CreativeModeInventoryScreenAccessor;
9
import com.tangykiwi.kiwiclient.module.Category;
10
import com.tangykiwi.kiwiclient.module.Module;
11
import com.tangykiwi.kiwiclient.module.setting.ToggleSetting;
12
13
import net.minecraft.client.KeyMapping;
14
import net.minecraft.client.gui.screens.ChatScreen;
15
import net.minecraft.client.gui.screens.Screen;
16
import net.minecraft.client.gui.screens.inventory.AbstractCommandBlockEditScreen;
17
import net.minecraft.client.gui.screens.inventory.AnvilScreen;
18
import net.minecraft.client.gui.screens.inventory.BookEditScreen;
19
import net.minecraft.client.gui.screens.inventory.CreativeModeInventoryScreen;
20
import net.minecraft.client.gui.screens.inventory.SignEditScreen;
21
import net.minecraft.client.gui.screens.inventory.StructureBlockEditScreen;
22
import net.minecraft.world.item.CreativeModeTabs;
23
24
public class InvMove extends Module {
25
    public InvMove() {
26
        super("InvMove", "Lets you move while in inventories", Category.MOVEMENT,
27
            new ToggleSetting("Sneak", "Allow sneaking", true),
28
            new ToggleSetting("Jump", "Allow jumping", true));
29
    }
30
31
    @Subscribe
32
    public void onTick(TickEvent event) {
33
        if (shouldInvMove(mc.gui.screen())) {
34
            for (KeyMapping k : new KeyMapping[] { mc.options.keyUp, mc.options.keyDown,
35
                    mc.options.keyLeft, mc.options.keyRight, mc.options.keyJump, mc.options.keyShift }) {
36
                k.setDown(InputConstants.isKeyDown(mc.getWindow(), InputConstants.getKey(k.saveString()).getValue()));
37
            }
38
39
            if (getSetting(0).asToggle().getValue()) {
40
                mc.options.keyShift.setDown(InputConstants.isKeyDown(mc.getWindow(), InputConstants.getKey(mc.options.keyShift.saveString()).getValue()));
41
            }
42
43
            if (getSetting(1).asToggle().getValue()) {
44
                mc.options.keyJump.setDown(InputConstants.isKeyDown(mc.getWindow(), InputConstants.getKey(mc.options.keyJump.saveString()).getValue()));
45
            }
46
        }
47
    }
48
49
    private boolean shouldInvMove(Screen screen) {
50
        if (screen == null) {
51
            return false;
52
        }
53
54
        return !(screen instanceof ChatScreen
55
                || screen instanceof BookEditScreen
56
                || screen instanceof SignEditScreen
57
                || screen instanceof AbstractCommandBlockEditScreen
58
                || screen instanceof StructureBlockEditScreen
59
                || screen instanceof AnvilScreen
60
                || (screen instanceof CreativeModeInventoryScreen
61
                && (CreativeModeInventoryScreenAccessor.getSelectedTab() == CreativeModeTabs.searchTab())));
62
    }
63
}
64