ElytraBounce module

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

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.

NicotineMovementsrc/client/java/nicotine/mod/mods/movement/ElytraBounce.javaJava · 110 lines · 3.4 KB
SettingsPitchACDelayYawLockThirdPerson
ElytraBounce.javaJava · Minecraft 26.3 · 110 lines · 3.4 KB · complete file, verbatimOriginal ↗
1
package nicotine.mod.mods.movement;
2
3
import com.mojang.blaze3d.platform.InputConstants;
4
import net.minecraft.client.CameraType;
5
import net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket;
6
import net.minecraft.world.item.ItemStack;
7
import net.minecraft.world.item.Items;
8
import nicotine.events.ClientLevelTickEvent;
9
import nicotine.events.PacketInEvent;
10
import nicotine.mod.Mod;
11
import nicotine.mod.ModCategory;
12
import nicotine.mod.option.KeybindOption;
13
import nicotine.mod.option.SliderOption;
14
import nicotine.mod.option.ToggleOption;
15
import nicotine.util.EventBus;
16
import nicotine.util.Player;
17
18
import java.util.Arrays;
19
import java.util.List;
20
21
import static nicotine.util.Common.mc;
22
23
public class ElytraBounce extends Mod {
24
    private int antiCheatDelay = 7;
25
    private boolean antiCheatTrigger = false;
26
    private float prevYaw = -1;
27
28
    private final SliderOption pitch = new SliderOption("Pitch", 85, 45, 180, true);
29
    private final SliderOption acDelay = new SliderOption("ACDelay", 7, 0, 20);
30
    private final ToggleOption yawLock = new ToggleOption("YawLock");
31
    private final ToggleOption thirdPerson = new ToggleOption("ThirdPerson");
32
33
    public ElytraBounce() {
34
        super(ModCategory.Movement, "ElytraBounce");
35
        this.keybind.keyCode = InputConstants.KEY_V;
36
        this.addOptions(Arrays.asList(pitch, acDelay, yawLock, thirdPerson));
37
    }
38
39
    @Override
40
    public void toggle() {
41
        this.enabled = !this.enabled;
42
43
        if (!this.enabled) {
44
            antiCheatTrigger = false;
45
            mc.options.keyJump.setDown(false);
46
            mc.options.setCameraType(CameraType.FIRST_PERSON);
47
            prevYaw = -1;
48
        }
49
    }
50
51
    @Override
52
    protected void init() {
53
        EventBus.register(ClientLevelTickEvent.class, event -> {
54
            if (!this.enabled)
55
                return true;
56
57
            List<ItemStack> armorItems = Player.getArmorItems();
58
59
            if (armorItems.get(2).getItem() != Items.ELYTRA || !mc.options.keyUp.isDown())
60
                return true;
61
62
            if (thirdPerson.enabled) {
63
                mc.options.setCameraType(CameraType.THIRD_PERSON_BACK);
64
            }
65
66
            if (!antiCheatTrigger) {
67
                if (mc.options.keyJump.isDown() && !mc.player.isFallFlying()) {
68
                    Player.startFlying();
69
                }
70
71
                mc.options.keyJump.setDown(true);
72
                mc.player.setXRot(pitch.value);
73
74
                if (yawLock.enabled) {
75
                    if (prevYaw == -1) {
76
                        prevYaw = mc.player.getYRot();
77
                    }
78
                    mc.player.setYRot(Math.round(prevYaw / 45) * 45);
79
                }
80
81
                mc.player.setSprinting(true);
82
83
            } else {
84
                if (antiCheatDelay <= 0) {
85
                    Player.startFlying();
86
                    antiCheatTrigger = false;
87
                    antiCheatDelay = (int)acDelay.value;
88
                } else {
89
                    mc.options.keyJump.setDown(false);
90
                    antiCheatDelay--;
91
                }
92
            }
93
94
            return true;
95
        });
96
97
        EventBus.register(PacketInEvent.class, event -> {
98
            if (!this.enabled || mc.player == null)
99
                return true;
100
101
            if (event.packet instanceof ClientboundPlayerPositionPacket) {
102
                antiCheatTrigger = true;
103
                mc.player.stopFallFlying();
104
            }
105
106
            return true;
107
        });
108
    }
109
}
110