How to detect if the player is crouching or jumping?
-
How to detect if the player is crouching or jumping?
So I'm trying to redo the Vanilla Fly as the script:
/// api_version=2 var script = registerScript({ name: "VanillaFly", version: "1.0.0", authors: ["kvuqq"] }); // Imported classes var MovementUtils = Java.type("net.ccbluex.liquidbounce.utils.MovementUtils"); script.registerModule({ name: "VanillaFly", category: "Movement", description: "Built-in vanilla fly, but as script" }, function(module) { module.on("motion", function() { MovementUtils.strafe(1) mc.thePlayer.motionY = 0; }); });and the original has that:
player.strafe(speed = 0.44) player.velocity.y = when { player.input.jumping -> 0.31 player.input.sneaking -> -0.31 else -> 0.0 }so I want to detect if the player is crouching/jumping.
-
How to detect if the player is crouching or jumping?
So I'm trying to redo the Vanilla Fly as the script:
/// api_version=2 var script = registerScript({ name: "VanillaFly", version: "1.0.0", authors: ["kvuqq"] }); // Imported classes var MovementUtils = Java.type("net.ccbluex.liquidbounce.utils.MovementUtils"); script.registerModule({ name: "VanillaFly", category: "Movement", description: "Built-in vanilla fly, but as script" }, function(module) { module.on("motion", function() { MovementUtils.strafe(1) mc.thePlayer.motionY = 0; }); });and the original has that:
player.strafe(speed = 0.44) player.velocity.y = when { player.input.jumping -> 0.31 player.input.sneaking -> -0.31 else -> 0.0 }so I want to detect if the player is crouching/jumping.
@mq ok nvm i found out how to check it
if (mc.gameSettings.keyBindSneak.pressed == true) { /* If crouching */ mc.thePlayer.motionY = -0.31; /* Go down */ } else if (mc.gameSettings.keyBindJump.pressed == true) { /* If jumping */ mc.thePlayer.motionY = 0.31; /* Go up */ } else { mc.thePlayer.motionY = 0; } -
@mq ok nvm i found out how to check it
if (mc.gameSettings.keyBindSneak.pressed == true) { /* If crouching */ mc.thePlayer.motionY = -0.31; /* Go down */ } else if (mc.gameSettings.keyBindJump.pressed == true) { /* If jumping */ mc.thePlayer.motionY = 0.31; /* Go up */ } else { mc.thePlayer.motionY = 0; }@mq You can also do mc.thePlayer.movementInput.sneak
-
@mq You can also do mc.thePlayer.movementInput.sneak
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login