Help With Fixing Code
-
Can Somebody Help Me To Get The Code Down Below To Work? I Am Slightly Confused On This Scripting API.
const script = registerScript({ name: "AntiVulcanLimit", version: "1.0.0", authors: ["IgniteTNT"] }); var sneakCooldown = 200; // Cooldown in milliseconds script.registerModule({ name: "VulcanLimit", category: "Misc", // Movement, Combat, Renderr, ... description: "Bypass Vulcan's Limit Check When Scaffolding" }, (mod) => { mod.on("enable", () => { Client.displayChatMessage("§aEnabled AntiVulcanLimit :)"); mc.gameSettings.keyBindSneak.pressed = true; setTimeout(function() { mc.gameSettings.keyBindSneak.pressed = false; }, sneakCooldown); }); mod.on("disable", () => { Client.displayChatMessage("§aDisabled AntiVulcanLimit :("); }); this.onGround = function(event) { mc.gameSettings.keyBindSneak.pressed = true; setTimeout(function() { mc.gameSettings.keyBindSneak.pressed = false; }, sneakCooldown); } }); -
-
const script = registerScript({ name: "AntiVulcanLimit", version: "1.0.0", authors: ["IgniteTNT"] }); var sneakCooldown = 200; // Cooldown in milliseconds script.registerModule({ name: "VulcanLimit", category: "Misc", // Movement, Combat, Renderr, ... description: "Bypass Vulcan's Limit Check When Scaffolding" }, (mod) => { mod.on("enable", () => { Client.displayChatMessage("§aEnabled AntiVulcanLimit :)"); mc.gameSettings.keyBindSneak.pressed = true; setTimeout(function() { mc.gameSettings.keyBindSneak.pressed = false; }, sneakCooldown); }); mod.on("disable", () => { Client.displayChatMessage("§aDisabled AntiVulcanLimit :("); }); mod.on("ground", function(event) { mc.gameSettings.keyBindSneak.pressed = true; setTimeout(function() { mc.gameSettings.keyBindSneak.pressed = false; }, sneakCooldown); }); });In this corrected version, I replaced this.onGround with mod.on("ground", ...), which correctly registers the event handler function.
-
Can Somebody Help Me To Get The Code Down Below To Work? I Am Slightly Confused On This Scripting API.
const script = registerScript({ name: "AntiVulcanLimit", version: "1.0.0", authors: ["IgniteTNT"] }); var sneakCooldown = 200; // Cooldown in milliseconds script.registerModule({ name: "VulcanLimit", category: "Misc", // Movement, Combat, Renderr, ... description: "Bypass Vulcan's Limit Check When Scaffolding" }, (mod) => { mod.on("enable", () => { Client.displayChatMessage("§aEnabled AntiVulcanLimit :)"); mc.gameSettings.keyBindSneak.pressed = true; setTimeout(function() { mc.gameSettings.keyBindSneak.pressed = false; }, sneakCooldown); }); mod.on("disable", () => { Client.displayChatMessage("§aDisabled AntiVulcanLimit :("); }); this.onGround = function(event) { mc.gameSettings.keyBindSneak.pressed = true; setTimeout(function() { mc.gameSettings.keyBindSneak.pressed = false; }, sneakCooldown); } });@IgniteTNT In this corrected version, I replaced this.onGround with mod.on("ground", ...), which correctly registers the event handler function.
const script = registerScript({ name: "AntiVulcanLimit", version: "1.0.0", authors: ["IgniteTNT"] }); var sneakCooldown = 200; // Cooldown in milliseconds script.registerModule({ name: "VulcanLimit", category: "Misc", // Movement, Combat, Renderr, ... description: "Bypass Vulcan's Limit Check When Scaffolding" }, (mod) => { mod.on("enable", () => { Client.displayChatMessage("§aEnabled AntiVulcanLimit :)"); mc.gameSettings.keyBindSneak.pressed = true; setTimeout(function() { mc.gameSettings.keyBindSneak.pressed = false; }, sneakCooldown); }); mod.on("disable", () => { Client.displayChatMessage("§aDisabled AntiVulcanLimit :("); }); mod.on("ground", function(event) { mc.gameSettings.keyBindSneak.pressed = true; setTimeout(function() { mc.gameSettings.keyBindSneak.pressed = false; }, sneakCooldown); }); }); -
There is no event called on ground. You should use one of the tick events...
-
@IgniteTNT U can try this:
let ticks = 0; //.... mod.on("update", () => { ticks++; if (ticks === 10) { // put it as your opinion mc.gameSettings.keyBindSneak.pressed = true; } else { mc.gameSettings.keyBindSneak.pressed = false; ticks = 0; } }
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