AutoGApple module

AutoGApple: Minecraft 26.3 cheat module, full source for every implementation (1 client: MelaHack (ThunderHack fork)).

1 implementationCOMBAT

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.

MelaHack (ThunderHack fork)COMBATsrc/main/java/thunder/hack/features/modules/combat/AutoGApple.javaJava · 60 lines · 2.5 KB

Automatically eats golden apples.

SettingsUseDelayhealthAbsorptionAutoTotemIntegration
AutoGApple.javaJava · Minecraft 26.2 · 60 lines · 2.5 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.features.modules.combat;
2
3
import meteordevelopment.orbit.EventHandler;
4
import net.minecraft.ChatFormatting;
5
import net.minecraft.world.item.Items;
6
import thunder.hack.core.manager.client.ModuleManager;
7
import thunder.hack.events.impl.PostPlayerUpdateEvent;
8
import thunder.hack.injection.accesors.IMinecraftClient;
9
import thunder.hack.features.modules.Module;
10
import thunder.hack.setting.Setting;
11
import thunder.hack.utility.Timer;
12
import thunder.hack.utility.player.InventoryUtility;
13
14
import static thunder.hack.features.modules.client.ClientSettings.isRu;
15
16
public final class AutoGApple extends Module {
17
    public final Setting<Integer> Delay = new Setting<>("UseDelay", 0, 0, 2000);
18
    private final Setting<Float> health = new Setting<>("health", 15f, 1f, 36f);
19
    public Setting<Boolean> absorption = new Setting<>("Absorption", false);
20
    public Setting<Boolean> autoTotemIntegration = new Setting<>("AutoTotemIntegration", true);
21
22
    private boolean isActive;
23
    private final Timer useDelay = new Timer();
24
25
    public AutoGApple() {
26
        super("AutoGApple", Category.COMBAT);
27
    }
28
29
    @EventHandler
30
    public void onUpdate(PostPlayerUpdateEvent e) {
31
        if (fullNullCheck()) return;
32
        if (GapInOffHand()) {
33
            if (mc.player.getHealth() + (absorption.getValue() ? mc.player.getAbsorptionAmount() : 0) <= health.getValue() && useDelay.passedMs(Delay.getValue())) {
34
                isActive = true;
35
                if (mc.gui.screen() != null && !mc.player.isUsingItem())
36
                    ((IMinecraftClient) mc).idoItemUse();
37
                else
38
                    mc.options.keyUse.setDown(true);
39
            } else if (isActive) {
40
                isActive = false;
41
                mc.options.keyUse.setDown(false);
42
            }
43
        } else if (isActive) {
44
            isActive = false;
45
            mc.options.keyUse.setDown(false);
46
        }
47
    }
48
49
    private boolean GapInOffHand() {
50
        if (autoTotemIntegration.getValue() && ModuleManager.autoTotem.isEnabled() && InventoryUtility.findItemInHotBar(Items.GOLDEN_APPLE, Items.ENCHANTED_GOLDEN_APPLE).found()) {
51
            if (!ModuleManager.autoTotem.rcGap.is(AutoTotem.RCGap.Off))
52
                return true;
53
            else
54
                sendMessage(ChatFormatting.RED + (isRu() ? "Включи RcGap в AutoTotem!" : "Enable RcGap in AutoTotem"));
55
        }
56
57
        return !mc.player.getOffhandItem().isEmpty() && (mc.player.getOffhandItem().getItem() == Items.GOLDEN_APPLE || mc.player.getOffhandItem().getItem() == Items.ENCHANTED_GOLDEN_APPLE);
58
    }
59
}
60