Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: OnlyMove in Modify Velocity #4302

Open
wants to merge 1 commit into
base: nextgen
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import net.ccbluex.liquidbounce.event.*
import net.ccbluex.liquidbounce.event.events.*
import net.ccbluex.liquidbounce.features.module.modules.combat.velocity.ModuleVelocity.modes
import net.ccbluex.liquidbounce.features.module.modules.player.nofall.modes.NoFallBlink
import net.ccbluex.liquidbounce.utils.entity.strafe
import net.ccbluex.liquidbounce.utils.entity.pressingMovementButton
import net.minecraft.network.packet.s2c.play.EntityVelocityUpdateS2CPacket
import net.minecraft.network.packet.s2c.play.ExplosionS2CPacket
import kotlin.random.Random
Expand All @@ -44,6 +44,7 @@ internal object VelocityModify : Choice("Modify") {
private val motionVertical by float("MotionVertical", 0f, 0f..1f)
private val chance by int("Chance", 100, 0..100, "%")
private val filter by enumChoice("Filter", VelocityTriggerFilter.ALWAYS)
private val onlyMove by boolean("OnlyMove", false)

@Suppress("unused")
private val packetHandler = handler<PacketEvent> { event ->
Expand All @@ -53,6 +54,7 @@ internal object VelocityModify : Choice("Modify") {
if (packet is EntityVelocityUpdateS2CPacket && packet.entityId == player.id) {
if (chance != 100 && Random.nextInt(100) > chance) return@handler
if (!filter.allow()) return@handler
if (onlyMove && !player.pressingMovementButton) return@handler

// It should just block the packet
if (horizontal == 0f && vertical == 0f) {
Expand Down Expand Up @@ -84,6 +86,7 @@ internal object VelocityModify : Choice("Modify") {
} else if (packet is ExplosionS2CPacket) { // Check if velocity is affected by explosion
if (chance != 100 && Random.nextInt(100) > chance) return@handler
if (!filter.allow()) return@handler
if (onlyMove && !player.pressingMovementButton) return@handler

// note: explosion packets are being used by hypixel to trick poorly made cheats.

Expand Down
Loading