Eagle module

Eagle: Minecraft 26.3 cheat module, full source for every implementation (1 client: LiquidBounce (Kotlin)).

1 implementationPLAYER

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.

LiquidBounce (Kotlin)PLAYERsrc/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/player/ModuleEagle.ktKotlin · 158 lines · 5.4 KB

Automatically sneaks at the edge of a block

SettingsEdgeDistanceConditionsPitch
ModuleEagle.ktKotlin · Minecraft 26.2 · 158 lines · 5.4 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.player
20
21
import net.ccbluex.liquidbounce.config.types.group.ToggleableValueGroup
22
import net.ccbluex.liquidbounce.config.types.list.Tagged
23
import net.ccbluex.liquidbounce.event.events.MovementInputEvent
24
import net.ccbluex.liquidbounce.event.handler
25
import net.ccbluex.liquidbounce.features.module.ClientModule
26
import net.ccbluex.liquidbounce.features.module.ModuleCategories
27
import net.ccbluex.liquidbounce.features.module.modules.render.ModuleDebug.debugParameter
28
import net.ccbluex.liquidbounce.features.module.modules.world.scaffold.ScaffoldBlockItemSelection.isValidBlock
29
import net.ccbluex.liquidbounce.utils.entity.isCloseToEdge
30
import net.ccbluex.liquidbounce.utils.kotlin.EventPriorityConvention.SAFETY_FEATURE
31
import net.ccbluex.liquidbounce.utils.kotlin.matchesAll
32
import net.ccbluex.liquidbounce.utils.kotlin.random
33
import java.util.function.Predicate
34
35
/**
36
 * An eagle module
37
 *
38
 * Legit trick to build faster.
39
 */
40
object ModuleEagle : ClientModule(
41
    "Eagle", ModuleCategories.PLAYER,
42
    aliases = listOf("FastBridge", "BridgeAssistant", "LegitScaffold")
43
) {
44
45
    private val edgeDistance by floatRange("EdgeDistance", 0.4f..0.6f, 0.01f..1.3f)
46
        .onChanged {
47
            currentEdgeDistance = it.random()
48
        }
49
50
    private var currentEdgeDistance: Float = edgeDistance.random()
51
    private var wasSneaking = false
52
    private var sneakCaptured = false
53
54
    private fun shouldActivateEagle(event: MovementInputEvent, conditionsMet: Boolean): Boolean {
55
        if (player.abilities.flying || !conditionsMet) {
56
            return false
57
        }
58
59
        return player.isCloseToEdge(event.directionalInput, currentEdgeDistance.toDouble())
60
    }
61
62
    private fun updateSneakCapture(originalSneak: Boolean, active: Boolean) {
63
        if (!Conditional.controlsSneak) {
64
            sneakCaptured = false
65
            return
66
        }
67
68
        when {
69
            !sneakCaptured && active && originalSneak -> sneakCaptured = true
70
            sneakCaptured && !originalSneak -> sneakCaptured = false
71
        }
72
    }
73
74
    private fun shouldOverrideSneak(conditionsMet: Boolean, active: Boolean): Boolean {
75
        return conditionsMet && Conditional.controlsSneak && (active || sneakCaptured)
76
    }
77
78
    private fun updateSneakState(isSneaking: Boolean) {
79
        if (isSneaking) {
80
            wasSneaking = true
81
            return
82
        }
83
84
        if (wasSneaking) {
85
            currentEdgeDistance = edgeDistance.random()
86
            wasSneaking = false
87
        }
88
    }
89
90
    private object Conditional : ToggleableValueGroup(this, "Conditional", true) {
91
        private val conditions by multiEnumChoice(
92
            "Conditions",
93
            Condition.ON_GROUND
94
        )
95
96
        val pitch by floatRange("Pitch", -90f..90f, -90f..90f)
97
98
        val controlsSneak
99
            get() = enabled && Condition.SNEAK in conditions
100
101
        fun shouldSneak(event: MovementInputEvent) =
102
            !enabled || player.xRot.coerceIn(-90f, 90f) in pitch && conditions.matchesAll(event)
103
104
        @Suppress("unused")
105
        private enum class Condition(override val tag: String) : Tagged, Predicate<MovementInputEvent> {
106
            LEFT("Left"),
107
            RIGHT("Right"),
108
            FORWARDS("Forwards"),
109
            BACKWARDS("Backwards"),
110
            HOLDING_BLOCKS("HoldingBlocks"),
111
            ON_GROUND("OnGround"),
112
            SNEAK("Sneak");
113
114
            override fun test(event: MovementInputEvent): Boolean = when (this) {
115
                LEFT -> event.directionalInput.left
116
                RIGHT -> event.directionalInput.right
117
                FORWARDS -> event.directionalInput.forwards
118
                BACKWARDS -> event.directionalInput.backwards
119
                HOLDING_BLOCKS -> isValidBlock(player.mainHandItem) || isValidBlock(player.offhandItem)
120
                ON_GROUND -> player.onGround()
121
                SNEAK -> event.sneak
122
            }
123
        }
124
    }
125
126
    init {
127
        tree(Conditional)
128
    }
129
130
    override fun onDisabled() {
131
        wasSneaking = false
132
        sneakCaptured = false
133
        super.onDisabled()
134
    }
135
136
    @Suppress("unused")
137
    private val handleMovementInput = handler<MovementInputEvent>(priority = SAFETY_FEATURE) { event ->
138
        debugParameter("EdgeDistance") { currentEdgeDistance }
139
140
        val originalSneak = mc.options.keyShift.isDown
141
        val conditionsMet = Conditional.shouldSneak(event)
142
        val isActive = shouldActivateEagle(event, conditionsMet)
143
144
        updateSneakCapture(originalSneak, isActive)
145
146
        val controlsSneak = shouldOverrideSneak(conditionsMet, isActive)
147
148
        event.sneak = if (controlsSneak) {
149
            isActive
150
        } else {
151
            originalSneak || isActive
152
        }
153
154
        updateSneakState(event.sneak)
155
    }
156
157
}
158