ElytraRecast module

ElytraRecast: Minecraft 26.3 cheat module, full source for every implementation (2 clients: MelaHack (ThunderHack fork), LiquidBounce (Kotlin)).

2 implementationsMOVEMENT

Full module source: 2 implementations

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

MelaHack (ThunderHack fork)MOVEMENTsrc/main/java/thunder/hack/features/modules/movement/ElytraRecast.javaJava · 126 lines · 4.7 KB

140 km/h highway elytra speed.

SettingsExploitChangePitchPitchValueAutoWalkAutoJumpAllowBroken
ElytraRecast.javaJava · Minecraft 26.2 · 126 lines · 4.7 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.features.modules.movement;
2
3
import com.mojang.blaze3d.platform.InputConstants;
4
import meteordevelopment.orbit.EventHandler;
5
import net.minecraft.network.protocol.game.ServerboundPlayerCommandPacket;
6
import net.minecraft.world.effect.MobEffects;
7
import net.minecraft.world.entity.EquipmentSlot;
8
import net.minecraft.world.entity.LivingEntity;
9
import net.minecraft.world.item.ItemStack;
10
import net.minecraft.world.item.Items;
11
import thunder.hack.ThunderHack;
12
import thunder.hack.events.impl.EventSync;
13
import thunder.hack.events.impl.EventTravel;
14
import thunder.hack.injection.accesors.ILivingEntity;
15
import thunder.hack.features.modules.Module;
16
import thunder.hack.setting.Setting;
17
import thunder.hack.utility.math.MathUtility;
18
19
//https://github.com/InLieuOfLuna/elytra-recast <-- Author of this exploit
20
public class ElytraRecast extends Module {
21
    public ElytraRecast() {
22
        super("ElytraRecast", Category.MOVEMENT);
23
    }
24
25
    public Setting<Exploit> exploit = new Setting<>("Exploit", Exploit.None);
26
    public Setting<Boolean> changePitch = new Setting<>("ChangePitch", true);
27
    public Setting<Float> pitchValue = new Setting<>("PitchValue", 55f, -90f, 90f, v -> changePitch.getValue());
28
    public Setting<Boolean> autoWalk = new Setting<>("AutoWalk", true);
29
    public Setting<Boolean> autoJump = new Setting<>("AutoJump", true);
30
    public Setting<Boolean> allowBroken = new Setting<>("AllowBroken", true);
31
32
    private float prevClientPitch, prevClientYaw, jitter;
33
34
    private enum Exploit {
35
        None, Strict, Strong
36
    }
37
38
    @EventHandler
39
    public void onSync(EventSync e) {
40
        if (changePitch.getValue())
41
            mc.player.setXRot(pitchValue.getValue());
42
43
        switch (exploit.getValue()) {
44
            case None -> {}
45
            case Strict -> mc.player.setYRot(mc.player.getYRot() + jitter);
46
            case Strong -> mc.player.setXRot(pitchValue.getValue() - Math.abs(jitter / 2f));
47
        }
48
    }
49
50
    @EventHandler
51
    public void modifyVelocity(EventTravel e) {
52
        if (changePitch.getValue())
53
            if (e.isPre()) {
54
                prevClientPitch = mc.player.getXRot();
55
                prevClientYaw = mc.player.getYRot();
56
                mc.player.setXRot(pitchValue.getValue());
57
58
                switch (exploit.getValue()) {
59
                    case None -> {
60
                    }
61
                    case Strict -> mc.player.setYRot(mc.player.getYRot() + jitter);
62
                    case Strong -> mc.player.setXRot(pitchValue.getValue() - Math.abs(jitter / 2f));
63
                }
64
            } else {
65
                mc.player.setXRot(prevClientPitch);
66
                if (exploit.getValue() == Exploit.Strict)
67
                    mc.player.setYRot(prevClientYaw);
68
            }
69
    }
70
71
    @Override
72
    public void onDisable() {
73
        if (!InputConstants.isKeyDown(mc.getWindow(), mc.options.keyUp.getDefaultKey().getValue()))
74
            mc.options.keyUp.setDown(false);
75
        if (!InputConstants.isKeyDown(mc.getWindow(), mc.options.keyJump.getDefaultKey().getValue()))
76
            mc.options.keyJump.setDown(false);
77
    }
78
79
    @Override
80
    public void onUpdate() {
81
        if (autoJump.getValue()) mc.options.keyJump.setDown(true);
82
        if (autoWalk.getValue()) mc.options.keyUp.setDown(true);
83
84
        if (!mc.player.isFallFlying() && mc.player.fallDistance > 0 && checkElytra() && !mc.player.isFallFlying())
85
            castElytra();
86
87
        jitter = (20 * MathUtility.sin((System.currentTimeMillis() - ThunderHack.initTime) / 50f));
88
89
        ((ILivingEntity) mc.player).setLastJumpCooldown(0);
90
    }
91
92
    public boolean castElytra() {
93
        if (checkElytra() && check()) {
94
            sendPacket(new ServerboundPlayerCommandPacket(mc.player, ServerboundPlayerCommandPacket.Action.START_FALL_FLYING));
95
            return true;
96
        }
97
        return false;
98
    }
99
100
    private boolean checkElytra() {
101
        if (mc.player.input.keyPresses.jump() && !mc.player.getAbilities().flying && !mc.player.isPassenger() && !mc.player.onClimbable()) {
102
            ItemStack is = mc.player.getItemBySlot(EquipmentSlot.CHEST);
103
            return isUsableElytra(is);
104
        }
105
        return false;
106
    }
107
108
    private boolean check() {
109
        if (!mc.player.isInWater() && !mc.player.hasEffect(MobEffects.LEVITATION)) {
110
            ItemStack is = mc.player.getItemBySlot(EquipmentSlot.CHEST);
111
            if (isUsableElytra(is)) {
112
                mc.player.startFallFlying();
113
                return true;
114
            }
115
        }
116
        return false;
117
    }
118
119
    private boolean isUsableElytra(ItemStack stack) {
120
        if (!stack.is(Items.ELYTRA)) {
121
            return false;
122
        }
123
        return allowBroken.getValue() || LivingEntity.canGlideUsing(stack, EquipmentSlot.CHEST);
124
    }
125
}
126
LiquidBounce (Kotlin)MOVEMENTsrc/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/movement/ModuleElytraRecast.ktKotlin · 64 lines · 2.2 KB

Recasts elytra while holding jump key.

ModuleElytraRecast.ktKotlin · Minecraft 26.2 · 64 lines · 2.2 KB · complete file, verbatimOriginal ↗
1
/*
2
 * This file is part of LiquidBounce (https://github.com/CCBlueX/LiquidBounce)
3
 *
4
 * Copyright (c) 2015 - 2026 CCBlueX
5
 *
6
 * LiquidBounce is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation, either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * LiquidBounce is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with LiquidBounce. If not, see <https://www.gnu.org/licenses/>.
18
 */
19
package net.ccbluex.liquidbounce.features.module.modules.movement
20
21
import net.ccbluex.liquidbounce.features.module.ClientModule
22
import net.ccbluex.liquidbounce.features.module.ModuleCategories
23
import net.ccbluex.liquidbounce.utils.item.isGlider
24
import net.minecraft.network.protocol.game.ServerboundPlayerCommandPacket
25
import net.minecraft.world.effect.MobEffects
26
import net.minecraft.world.entity.EquipmentSlot
27
28
/**
29
 * Elytra recast module
30
 *
31
 * Recasts elytra when holding the jump key
32
 *
33
 * @author Pivo1lovv
34
 */
35
object ModuleElytraRecast : ClientModule("ElytraRecast", ModuleCategories.MOVEMENT) {
36
37
    private val shouldRecast: Boolean
38
        get() {
39
            val itemStack = player.getItemBySlot(EquipmentSlot.CHEST)
40
41
            return !player.abilities.flying && !player.isPassenger && !player.onClimbable() &&
42
                !player.isInWater && !player.hasEffect(MobEffects.LEVITATION) && !player.isFallFlying &&
43
                itemStack.isGlider && !itemStack.nextDamageWillBreak() && mc.options.keyJump.isDown
44
        }
45
46
    /**
47
     * Recast elytra when [shouldRecast] says it should
48
     *
49
     * @return true if elytra was recast
50
     */
51
    fun recastElytra(): Boolean {
52
        if (shouldRecast) {
53
            player.startFallFlying()
54
            network.send(
55
                ServerboundPlayerCommandPacket(player, ServerboundPlayerCommandPacket.Action.START_FALL_FLYING)
56
            )
57
            return true
58
        }
59
60
        return false
61
    }
62
63
}
64