TotemEffect module

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

1 implementationRENDER

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)RENDERsrc/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/render/totemeffect/ModuleTotemEffect.ktKotlin · 78 lines · 2.9 KB

Renders an effect when players use a totem of undying.

ModuleTotemEffect.ktKotlin · Minecraft 26.2 · 78 lines · 2.9 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
20
package net.ccbluex.liquidbounce.features.module.modules.render.totemeffect
21
22
import net.ccbluex.liquidbounce.annotations.ValueClassCandidate
23
import net.ccbluex.liquidbounce.event.events.PacketEvent
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.utils.collection.ExpiringList.Companion.ExpiringList
28
import net.minecraft.network.protocol.game.ClientboundEntityEventPacket
29
import net.ccbluex.liquidbounce.features.module.modules.render.totemeffect.modes.TotemEffectShockwave
30
import net.ccbluex.liquidbounce.features.module.modules.render.totemeffect.modes.TotemEffectSoul
31
import net.ccbluex.liquidbounce.utils.combat.shouldBeShown
32
import net.ccbluex.liquidbounce.utils.network.isDeathProtection
33
import net.minecraft.world.entity.Entity
34
import net.minecraft.world.phys.Vec3
35
36
object ModuleTotemEffect : ClientModule("TotemEffect", ModuleCategories.RENDER) {
37
38
    val entities = ExpiringList<TotemPopSnapshot>()
39
40
    val modes = choices("Mode", 0) {
41
        arrayOf(
42
            TotemEffectShockwave,
43
            TotemEffectSoul
44
        )
45
    }.apply { tagBy(this); onChanged { entities.clear() } }
46
47
    override fun onDisabled() { entities.clear() }
48
49
    @Suppress("unused")
50
    private val totemHandler = handler<PacketEvent> { event ->
51
        val packet = event.packet as? ClientboundEntityEventPacket ?: return@handler
52
        if (!packet.isDeathProtection) return@handler
53
54
        mc.execute {
55
            val entity = event.packet.getEntity(world).takeIf { it.shouldBeShown() } ?: return@execute
56
57
            val lifetime = modes.activeMode.lifetime
58
            entities.add(TotemPopSnapshot(entity), lifetime)
59
        }
60
    }
61
62
    @ValueClassCandidate
63
    data class TotemPopSnapshot(
64
        val pos: Vec3,
65
        val xRot: Float,
66
        val yRot: Float,
67
        val bbHeight: Float,
68
    ) {
69
        constructor(entity: Entity) : this(
70
            pos = entity.position(),
71
            xRot = entity.xRot,
72
            yRot = entity.yRot,
73
            bbHeight = entity.bbHeight
74
        )
75
    }
76
77
}
78