NoBlockInteract module

NoBlockInteract: 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/ModuleNoBlockInteract.ktKotlin · 78 lines · 2.6 KB

Prevents you from interacting with blocks.

ModuleNoBlockInteract.ktKotlin · Minecraft 26.2 · 78 lines · 2.6 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.player
21
22
import net.ccbluex.liquidbounce.event.events.GameTickEvent
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.injection.mixins.minecraft.client.MinecraftAccessor
28
import net.ccbluex.liquidbounce.utils.block.getBlock
29
import net.ccbluex.liquidbounce.utils.block.isInteractable
30
import net.ccbluex.liquidbounce.utils.block.state
31
import net.ccbluex.liquidbounce.utils.item.isInteractable
32
import net.minecraft.world.phys.BlockHitResult
33
34
/**
35
 * NoBlockInteract module
36
 *
37
 * Allows to use items without interacting with blocks.
38
 */
39
object ModuleNoBlockInteract : ClientModule("NoBlockInteract", ModuleCategories.PLAYER) {
40
41
    private var sneaking = false
42
    private var interacting = false
43
44
    fun startSneaking() {
45
        sneaking = true
46
    }
47
48
    @Suppress("unused")
49
    private val handleMovementInput = handler<MovementInputEvent> { event ->
50
        if (sneaking) {
51
            event.sneak = true
52
            interacting = true
53
        }
54
    }
55
56
    @Suppress("unused")
57
    private val handleGameTick = handler<GameTickEvent> {
58
        if (interacting) {
59
            (mc as MinecraftAccessor).callStartUseItem()
60
            interacting = false
61
            sneaking = false
62
        }
63
    }
64
65
    fun shouldSneak(blockHitResult: BlockHitResult): Boolean {
66
        if (player.isShiftKeyDown) {
67
            return false
68
        }
69
70
        val blockPos = blockHitResult.blockPos
71
        if (!blockPos.getBlock().isInteractable(blockPos.state)) {
72
            return false
73
        }
74
75
        return player.mainHandItem.isInteractable() || player.offhandItem.isInteractable()
76
    }
77
}
78