AutoWindCharge module

AutoWindCharge: 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/ModuleAutoWindCharge.ktKotlin · 114 lines · 4.3 KB

Automatically boosts you using wind charges when holding jump.

SettingsPitchKeyCombatPauseTimeSlotResetDelay
ModuleAutoWindCharge.ktKotlin · Minecraft 26.2 · 114 lines · 4.3 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 com.mojang.blaze3d.platform.InputConstants
22
import net.ccbluex.liquidbounce.config.types.group.ToggleableValueGroup
23
import net.ccbluex.liquidbounce.event.tickConditional
24
import net.ccbluex.liquidbounce.event.tickHandler
25
import net.ccbluex.liquidbounce.features.module.ClientModule
26
import net.ccbluex.liquidbounce.features.module.ModuleCategories
27
import net.ccbluex.liquidbounce.features.module.modules.player.ModuleAutoWindCharge.Rotate.rotations
28
import net.ccbluex.liquidbounce.utils.aiming.RotationManager
29
import net.ccbluex.liquidbounce.utils.aiming.RotationsValueGroup
30
import net.ccbluex.liquidbounce.utils.aiming.data.Rotation
31
import net.ccbluex.liquidbounce.utils.combat.CombatManager
32
import net.ccbluex.liquidbounce.utils.entity.FallingPlayer
33
import net.ccbluex.liquidbounce.utils.entity.getMovementDirectionOfInput
34
import net.ccbluex.liquidbounce.utils.input.isPressed
35
import net.ccbluex.liquidbounce.utils.inventory.Slots
36
import net.ccbluex.liquidbounce.utils.inventory.useHotbarSlotOrOffhand
37
import net.ccbluex.liquidbounce.utils.kotlin.Priority
38
import net.minecraft.world.item.Items
39
40
/**
41
 * Uses wind charges to boost yourself up when holding jump.
42
 */
43
object ModuleAutoWindCharge : ClientModule("AutoWindCharge", ModuleCategories.PLAYER) {
44
45
    private object Rotate : ToggleableValueGroup(this, "Rotate", true) {
46
        val rotations = tree(RotationsValueGroup(this))
47
    }
48
49
    private object HorizontalBoost : ToggleableValueGroup(this, "HorizontalBoost", true) {
50
        val pitch by float("Pitch", 70f, 0f..90f)
51
        val boostKey by key("Key", InputConstants.KEY_LCONTROL)
52
    }
53
54
    init {
55
        treeAll(HorizontalBoost, Rotate)
56
    }
57
58
    private val combatPauseTime by int("CombatPauseTime", 0, 0..40, "ticks")
59
    private val slotResetDelay by intRange("SlotResetDelay", 0..0, 0..40, "ticks")
60
61
    /**
62
     * 7 ticks is the perfect time to use a wind charge before hitting the ground,
63
     * and drastically boosts us higher.
64
     */
65
    const val PREDICTION_TICKS = 7
66
67
    @Suppress("unused")
68
    private val autoWindChargeHandler = tickHandler {
69
        if (player.isFallFlying || player.isSwimming || player.isInLiquid || !mc.options.keyJump.isDown) {
70
            return@tickHandler
71
        }
72
73
        val collision = FallingPlayer
74
            .fromPlayer(player)
75
            .findCollision(PREDICTION_TICKS) ?: return@tickHandler
76
77
        val itemSlot = Slots.OffhandWithHotbar.findSlot(Items.WIND_CHARGE) ?: return@tickHandler
78
79
        val isHorizontalBoost = HorizontalBoost.enabled && HorizontalBoost.boostKey.isPressed
80
        val directionYaw = player.getMovementDirectionOfInput() - 180f
81
        val directionPitch = when {
82
            isHorizontalBoost -> HorizontalBoost.pitch
83
            else -> 90f
84
        }
85
86
        var rotation = Rotation(directionYaw, 80f)
87
88
        if (Rotate.enabled) {
89
            fun isRotationSufficient(): Boolean {
90
                return RotationManager.serverRotation.directionAngleTo(rotation) <= 1.0f
91
            }
92
93
            tickConditional(20) {
94
                CombatManager.pauseCombatForAtLeast(combatPauseTime)
95
                RotationManager.setRotationTarget(
96
                    rotations.toRotationTarget(rotation),
97
                    Priority.IMPORTANT_FOR_USAGE_3,
98
                    this@ModuleAutoWindCharge
99
                )
100
101
                isRotationSufficient()
102
            }
103
104
            if (!isRotationSufficient()) {
105
                return@tickHandler
106
            }
107
        }
108
109
        val (yaw, pitch) = rotation.normalize()
110
        useHotbarSlotOrOffhand(itemSlot, slotResetDelay.random(), yaw, pitch)
111
    }
112
113
}
114