[TUTORIAL] How to add a basic speed mode
-
Re: [SUPPORT] How to make a basic speed mode?
Since this post, I have gotten way better at coding, and can explain some things about how to make speed modes. Ok, so first, you have to choose which folder you're going to use, or if you're going to make a new one.
For an example, I'm going to choose to make it in the “other” folder, since that's really used anyway. I'm going to name the file “Strafe” with the Kotlin file extension, so it's going to be “Strafe.kt”.
Here's how the file's going to start:/* * LiquidBounce Hacked Client * A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge. * https://github.com/CCBlueX/LiquidBounce/ */
Now, I'm going to set the package used, by adding this:
package net.ccbluex.liquidbounce.features.module.modules.movement.speedmodes.other
Now, we want to get the proper imports (to be able to add the stuff), so, we're going to have to add those imports (you only have to add the ones you're going to use).
import net.ccbluex.liquidbounce.features.module.modules.movement.speedmodes.SpeedMode // To register the speed mode import net.ccbluex.liquidbounce.utils.MovementUtils.isMoving // To check if the player is moving import net.ccbluex.liquidbounce.utils.MovementUtils.strafe // To make the player strafe
Great, now that we have done that, let's register the speed mode properly; for the example, I'm going to name it “Strafe”, as the file name suggests.
object Strafe : SpeedMode("Strafe")
Now, we have to add the {} at the start and end of the file (DO NOT FORGET THIS).
Since you have done that by now, I'm going to show you the rest of the code, with code commentary.override fun onUpdate() { if (mc.thePlayer == null) { return } if (mc.thePlayer.onGround && isMoving) { mc.thePlayer.jump() } strafe() }
The full file should look like this:
/* * LiquidBounce Hacked Client * A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge. * https://github.com/CCBlueX/LiquidBounce/ */ package net.ccbluex.liquidbounce.features.module.modules.movement.speedmodes.other import net.ccbluex.liquidbounce.features.module.modules.movement.speedmodes.SpeedMode // To register the speed mode import net.ccbluex.liquidbounce.utils.MovementUtils.isMoving // To check if the player is moving import net.ccbluex.liquidbounce.utils.MovementUtils.strafe // To make the player strafe object Strafe : SpeedMode("Strafe") { override fun onUpdate() { if (mc.thePlayer == null) { return } if (mc.thePlayer.onGround && isMoving) { mc.thePlayer.jump() } strafe() } }
Now, we have to make the speed mode actually show on Speed. Therefore, we have to access Speed.kt, and add this to line 54:
, Strafe
Now, you are good to go! You have made a speed mode.