Skip to content

Custom Modules

SenkJu edited this page Oct 30, 2018 · 9 revisions

Example

function ExampleModule() {

    // 'getName()' returns the name of the module. This name will be used in the ClickGUI/TabGUI.
    this.getName = function() {
        return "TestModule";
    };

    /* 'getDescription()' returns the description of the module. 
    It can be seen when hovering the module in the ClickGUI. */
    this.getDescription = function() {
        return "This module has been created using LiquidBounce's scripting API.";
    };

    // 'getCategory()' returns the name of the ClickGUI/TabGUI category the module should be added to.
    this.getCategory = function() {
        return "Exploit";
    };

    // 'onEnable()' is being executed once the user activated the module.
    this.onEnable = function() {
        chat.print("§c§lHey! I am now enabled.");
    };

    /* 'onDisable()' is being executed once the user disabled the module. 
    Changed Minecraft values should be reset here. */
    this.onDisable = function() {
        chat.print("§c§lBye! I am now disabled.");
    };

    /* 'onUpdate()' is being executed constantly (every tick => 20 times per seconds) 
    if the module is enabled. */
    this.onUpdate = function() {
        mc.thePlayer.swingItem();
    }
}

Module Events

this.onEnable = function() {
    // Code in here will be executed directly after the module has been enabled by the user 
};

this.onDisable = function() {
    // Code in here will be executed directly after the module has been disabled by the user 
};

this.onUpdate = function() {
    // Code in here is being executed every tick (~20 times per seconds)
};

this.onMotion = function() {
    // Code in here is being executed everytime the player receives motion
};

this.onRender2D = function() {
    // Code in here will be executed when the client draws its 2D elements
};

this.onRender3D = function() {
    // Code in here will be executed when the client draws its 3D elements
};