Skip to content

[BUG] ScriptAPI Event That Is Efficient #4447

Description

@11334464

LiquidBounce Branch

Nextgen

LiquidBounce Build/Version

ALL

Operating System

Windows 11

Minecraft Version

1.21.1

Describe the bug

I need an efficient event to run every tick but when i use playertick as event, IT LAGS AND DROPS MY FPS A LOT!!!! HOW DOES BUILT IN MODULES BE SO EFFICIENT?

for example, SCAFFOLD, it needs to check the block below it every tick to keep you from falling but IT DOESNT AFFECT MY FPS AT ALL but playertick AFFECTS IT SO MUCH.

Is there another event that doesnt lag my game like the builtin modules? I checked most but all affect my fps a lot, brings it down from stable 60fps TO 20-40 FPS!!!!!

(I also wanna check from ~-1 to 0 in Y EFFICIENTLY cuz this is a autoclutch module so that you dont fall into the void without using Antivoid, Maybe how to use the DEBUGGER and its predictions to check if my Y would be in 0 and turn on scaffold cuz then it would be a FULLY AUTOMATIC SCAFFOLD WHICH IS COOL AND TURNS ON FOR YOU)

how to also have a "TICKS UNTIL RESET" like Scaffold

// Registering the script
const script = registerScript({
    name: "AutoClutch",
    version: "1.0.0",
    authors: ["mbash"]
});

// Importing necessary classes
const blockutil = BlockUtil;
const interactionutil = InteractionUtil;
const rotationutil = RotationUtil;
const movement = MovementUtil;
const client = Client;

// Registering the Scaffold Module
script.registerModule({
    name: "AutoClutch",
    category: "Movement",
    description: "Automatically places blocks while moving."
}, (mod) => {
    mod.on("playerTick", () => {
		const player = mc.player;
		
        let blockBelow = BlockUtil.getBlock(blockutil.newBlockPos(Math.floor(player.getX()) + 0, Math.floor(player.getY()) - 1, Math.floor(player.getZ()) + 0));
        
        // Convert the block type to a string to display
        let blockName = blockBelow.toString();  // toString gives a string representation of the block
        
        // Display the block's name in the chat
        Client.displayChatMessage("Block below: " + blockName);
		
        
        // Check if the block below is air
        if (blockName.includes("air")) {  // Checking if it's air (it will contain "air" in its name)
            // Enable the scaffold module if over the void
            client.moduleManager.getModuleByName("Scaffold").enabled = true;
        } else {
            // Disable the scaffold module if on solid ground
            client.moduleManager.getModuleByName("Scaffold").enabled = false;
        }
    });

    mod.on("disable", () => {
        // Ensure scaffold is disabled when this module is turned off
        client.moduleManager.getModuleByName("Scaffold").enabled = false;
    });
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions