Help With Fixing Code
Unsolved
ScriptAPI
-
-
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.
-
@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; } }