Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

LiquidBounce Forum

C

commandblock2

@commandblock2
About
Posts
140
Topics
9
Shares
0
Groups
1
Followers
8
Following
1

Posts

Recent Best Controversial

  • BlockBBEvent in scripts?
    C commandblock2

    @idk-my-name
    Indeed there is no onBlockBB provided.
    Before this someone showed me the matrix fly (rewinside + jump, patched) made by aftery in scriptapi(obf), it would be almost impossible to implement without blockBB. I didn't figure out back then
    It took me a long time to finally figured out a way to subscribe to arbitrary event in scriptAPI with reflection and Java.extend.
    Hint:

    Java.extend(Listenable, Consumer, {
        handleEvents: function() { return true},
        accept: function(e) {
    
        }
    })
    

    and this.

    General

  • BlockBBEvent in scripts?
    C commandblock2

    @idk-my-name
    What Java.extend() returns is something that behaves like a type (Forgot what it really is, probably a JSAdaptor or something).
    Similar to what you will get from using Java.type().

    ArrayList = Java.type("java.util.ArrayList")
    arrayList = new ArrayList()
    
    BBConsumer = Java.extend(Listenable, Consumer, {
        handleEvents: function() { return true},
        accept: function(e) {
            // onBlockBB here
            
        }
    })
    
    consumer = new BBConsumer()
    registerListener(consumer)
    // not registerListener(BBConsumer)
    /* I am sure there would be a better name for BBConsumer
    And if you want to use it like a anonymous class in Java you could just read the BlockAnimations.js or better,  nashorn document
    https://github.com/CzechHek/Core/blob/879f36d7e41ccc7868285b0a808866b360f30822/Scripts/BlockAnimations.js#L35
    */  
    

    Not sure if the type from Java.extend would have other unexpected methods that only takes 1 parameters, you might want to check if the parameter's super class is Event.

    Or you could just explicitly specify the accept method in it.
    method = consumer.class.getMethod("accept", java.lang.Object.class)

    Edit:
    Nvm, I forgot that this was scriptAPI, the Consumer here is a Consumer<?>, not Consumer<BlockBBEvent> which means the accepct() takes an java.lang.Object, and it will register a Listener that listens to any event that is an java.lang.Object, which probably means all events.'

    Here is what I did

    registry = getField(LiquidBounce.eventManager, "registry").get(LiquidBounce.eventManager)
    BBs = registry.getOrDefault(BlockBBEvent.class, new ArrayList())
    BBs.add(new EventHook(consumer, 
            consumer.class.getMethod("accept", java.lang.Object.class), 
            LiquidBounce.moduleManager.class
                    .getDeclaredMethod("onKey", KeyEvent.class)
                    .getAnnotation(EventTarget.class)))
    registry[BlockBBEvent.class] = BBs
    
    General

  • is it possible to use c++ as scripting language in liquidbounce?
    C commandblock2

    @idk-my-name Possible, but not doable. Use JNI, but too much work. Also itunes is botnet.

    Off-Topic

  • mc.thePlayer is undefined
    C commandblock2

    @cancernameu
    Here on my machine

    mc.thePlayer
    EntityPlayerSP['commandblock2'/100, l='MpServer', x=539.17, y=4.00, z=-585.11]
    

    If you want to get the class of mc.thePlayer

    mc.thePlayer.class
    class net.minecraft.client.entity.EntityPlayerSP
    
    mc.thePlayer.class.getSimpleName()
    EntityPlayerSP
    
    mc.thePlayer.class.getSimpleName() == "EntityPlayerSP"
    true
    
    typeof mc.thePlayer
    object
    

    That's probably what you want

    EntityPlayerSP = Java.type("net.minecraft.client.entity.EntityPlayerSP")
    [JavaClass net.minecraft.client.entity.EntityPlayerSP]
    
    mc.thePlayer instanceof EntityPlayerSP
    true
    

    instanceof can be used for java types, this is basically a nashorn thing.
    https://www.oracle.com/technical-resources/articles/java/jf14-nashorn.html

    ScriptAPI

  • [Help]TeleportAura.kt
    C commandblock2

    This is commandblock222 infiniteaura or rechaura.kt
    I want to use it But I won't use java to kotlin want to rewrite this crap and port to cross_version (also 1 more feature to phase through wall)
    Who can help me convert this KT file-_- refactor it
    ~~[InfiniteAura or reachaura]https://wws.lanzous.com/iOk2wgm9l4h~~
    InfiniteAura or reachaura
    Hey ↑ Link

    xDDDDDDDD

    Jokes aside, I do plan to rewrite this when I have time, but won't rewrite in js. However there are some problems.

    • the code is completely shit
    • I want to add a customizable pathfinding thing, not only for reachaura, but also for scripting, and the rule of pathfinding could be customized (for example ground only or fly or phase-able ),
    • improve the packet counter option. (simply adjust cps when sending too much)
    Kotlin/Java

  • BlockBBEvent in scripts?
    C commandblock2

    @idk-my-name
    Indeed something like that.

    val eventClass = method.parameterTypes[0] as Class<out Event>
    val eventTarget = method.getAnnotation(EventTarget::class.java)
    

    Unfortunately, nashorn/reflection does not have any capability of adding annotations.
    method.getAnnotation(EventTarget::class.java)
    and we will have to make our own registerListener().

    The 3 lines actually does the work is here.

    val invokableEventTargets = registry.getOrDefault(eventClass, ArrayList())
    invokableEventTargets.add(EventHook(listener, method, eventTarget))
    registry[eventClass] = invokableEventTargets
    

    You only need to convert this 3 line to js and it would be fine.
    Note the second line
    EventHook(listener, method, eventTarget)
    the listener is just the listener,
    the method is accept acquired using reflection
    but for the eventTarget, I borrowed it with reflection from a function in other class that extends Listener already presented in LB.

    As for the performance issue, it's true, in my case, putting a print every time it is called makes the frame rate goes from 80(limited) to less than 1.

    General

  • Help writing a custom prison mining script
    C commandblock2

    A way to path find from /mine to the mining location

    This could be a bit much work to do. U might have to write a path finding algorithm like A*. However I do have a A* in my reachaura branch. Could be hell if u try to write it in js.

    A 'legit' mining mode (I know how to activate modules via script so I might just use nuker)

    Look for RotationUtils.faceBlock method in Nuker.kt in LB's src (cross_version here), it would be a bit different with/without cross_version.

    Check if inventory is full

    Maybe look at the inventory related module of LB and Hek's InventoryManger. Shouldn't be as hard as A*.

    Interact/Right Click NPC

    There is a packet for that and u can find the usage in KillAura.kt.

    Text related operation

    https://github.com/CzechHek/Core/blob/master/Scripts/Deprecated/BasicLogin.js

    ScriptAPI

  • [Help]TeleportAura.kt
    C commandblock2

    @yorik100 The phase that works smoothly (no S08) in vanilla is the mineplex mode. I now see how that works.

    Kotlin/Java

  • Help writing a custom prison mining script
    C commandblock2

    @paranoid_bres Indeed there is a builtin pathfinding for minecraft (net.minecraft.pathfinding), but it seemed that it only has the behavior for Climber/Ground/Swimmer things, mining might require a different one which can navigate through stones. But you do remind me that you can just inherit the net.minecraft.pathfinding.PathNavigate and might be less work. Btw it is generally recommended to have a copy of mcp or do gradlew setupDecompWorkspace in LB's repo and attach the src to the project.
    Edit: I didn't know it runs into blocks

    ScriptAPI

  • [Help]TeleportAura.kt
    C commandblock2

    @yorik100 is it able to phase through multiple blocks in one go or just better implementation?

    Kotlin/Java

  • An alternative FreeCam implementation.
    C commandblock2

    This alternative implementation is theoretically 100% legit since this is based on changing the position/angle of the camera.
    vlcsnap-2021-08-26-21h53m07s589.png
    Demo: https://www.bilibili.com/video/BV1rv411N7SC/
    The commit is here: https://github.com/commandblock2/LiquidBounce/commit/4d54b5a8e4b48dd68779678b22ee81f9b3aeb54d

    I wrote this simply to prove this idea could work and this is currently not intended to merge to the official branch as there could be tons of improvement (

    • able to cancel player movement input
    • absolute coord choice (doesn't move according to player)
    • proper injection near net/minecraft/client/render/GameRenderer.java:1043 (maybe) instead of in Camera class
    • etc.
      ) and I am just too lazy/busy to make any of that. Anyone who wants it should make the improvement and make the pr.
    0 commandblock2 committed to commandblock2/LiquidBounce
    added FreecamAlternative
    General Discussion

  • [Guide] Typescript definition for Minecraft and LiquidBounce
    C commandblock2

    Following repo means

    demo

    https://github.com/commandblock2/minecraft-LBNG-types.
    9094e21e-c6b5-4f3b-b562-92cd701ba7e3-image.png

    minecraft-LBNG-types


    DISCLAIMER: Use this at your own risk!!! This is an unofficial project not endorsed by Mojang or fabric developers. This repo does NOT

    • contains any generated minecraft type definitions by itself
    • redistribute the game itself
    • guarentee the correctness of the generated definition

    This repo contains

    • instruction and scripts for creating typescript definitions
      • for Minecraft (with mods*)
      • for LiquidBounce NextGen
      • for everything inside of the jvm
    • typescript definitions for embedded context of LiquidBounce NextGen scriptAPI
    • a set of manually maintained patches to make the script api work properly
    • a set of examples LiquidBounce NextGen script using typescript
    • a compiler script that will compile all the .ts files into .js files that could run in graaljs (LiquidBounce NextGen runtime) with watch mode
    • some prompt files to use on LLMs, specifically for claude + continue.dev vscode extension, at .continue/prompts.

    Note: the mods are only limited to those presented at the development environment of LiquidBounce NextGen.

    When writing your script in typescript, expect inconsistencies with script API in js, but please report them to this repo if you can

    Instruction (subject to change)

    Adjust the order flexibly to your needs.

    Generating the typescript definitions

    1. Setup development environment for Liquidbounce NextGen

    2. Clone LBNG, run git checkout 451cb31e9bf093fe07f9b28202bc2471921ea13d (for version 0.29.0 release) and launch with gradle ./gradlew runClient without intellij idea(recommened because of the sheer amount of memory it takes to generate the definition).

    3. Place the LBNG-script/ts-defgen.js in your script folder for LiquidBounce

    4. Build or download the latest released ts-generator jar from github, place it in your script folder as well.

    5. Do a .script reload in your client, this should load the ts-defgen.js

    6. Run the .ts-defgen command

    7. See messages from chat and wait for around a few minute or more or less depending on your setup, this may take a while and also nearly 7GB of additional RAM (other than your intellij idea plus the what Minecraft needs in it's original state, causes OOM for me a lot of times xD).

    Now you can find a types-gen folder in your script folder, this contains the generated typescript definitions.

    .
    ├── ts-defgen.js
    ├── ts-generator-1.1.1.jar
    └── types-gen
        └── minecraft-yarn-definitions
            ├── package.json
            ├── tsconfig.json
            └── types
                ├── ai
                ├── com
                ├── _COROUTINE
                ├── de
                ├── io
                ├── it
                ├── java
                ├── javax
                ├── jdk
                ├── joptsimple
                ├── kotlin
                ├── kotlinx
                ├── net
                ├── okhttp3
                ├── okio
                ├── org
                ├── oshi
                └── sun
    ├── ... other scripts.js
    
    

    Writing scripts with TypeScript Support

    1. Run npm install in this directory.
    2. copy the generated folder types-gen to generated-modules folder in the root of your project.
    3. Run the script apply-patch with npm run apply-patches
    4. Run npm install file:./generated-modules/types-gen/minecraft-yarn-definitions/ --no-save, no-save for now, not sure if I should do this.
    5. Open the template.ts file and try start writing your script, you should see TypeScript type hints for all the classes that are available. vscode will automatically generate working imports, but you should not touch the import statement with @embedded namespace.
    6. Run the script compile with npm like step 4 or npm run watch
    7. Corresponding javascript file is generated in the dist directory, you can link this dist directory to your scripts directory in LB.

    Contribution and TODOs

    If you know how to better organize this project (architecture), please feel free to submit a PR.

    If you find errors on generated definitions about Minecraft classes or LiquidBounce classes, please file your tick at ts-generator.

    If you find a un-intended behavior in the ts-defgen.js, compile script or manually maintained definitions(TODO), please file an issue here.

    License

    This project is licensed under the GNU General Public license, see LICENSE for more information.

    vscode-file___vscode-app_opt_vscodium_resources_app_out_vs_code_electron-sandbox_workbench_workbench.html-cropped.png

    Scripts

  • Help me how to convert?
    C commandblock2

    just remove the type C0FPacketConfirmTransaction then. Since JavaScript is a dynamically typed language, the type is determined at runtime. If the packet is a instance of a C0FPacketConfirmTransaction you can call getWindowId() and getUid() then if it is not, exceptions should be thrown.

    //if (event.getPacket() instanceof C0FPacketConfirmTransaction)
        packetConfirmTransaction = event.getPacket();
    
    ScriptAPI

  • What to use as a maintained LiquidBounce 1.8.9 alternative?
    C commandblock2

    @somedudeyouveneverheardof

    Same as Aftery I seldomly use the client recently.

    But as of my experience I would use the latest b73 before cross version but that is quite out-dated as well. I didn't use the nextgen simply because of I couldn't have autoblock with multiconnect (I didn't even bother trying viafabric or to solve the problem but I've seen someone doing it).

    Here is where you could see many forks.
    https://github.com/CCBlueX/LiquidBounce/network

    I just discovered this fork today and it seemed to be interesting.
    https://github.com/hsheric0210/LiquidBounce
    Updated 9 days ago.
    This fork is not based on Nextgen but it's cross version so I guess many scripts may not work as well. But it seemed to have more than enough options. Maybe you could give it a try.

    KillAura from hsheric0210: https://github.com/hsheric0210/LiquidBounce/blob/master/shared/main/java/net/ccbluex/liquidbounce/features/module/modules/combat/KillAura.kt
    KillAura from FDP: https://github.com/UnlegitMC/FDPClient/blob/master/src/main/java/net/ccbluex/liquidbounce/features/module/modules/combat/KillAura.kt

    General Discussion

  • Windows Security Dashboard doesnt show up
    C commandblock2

    unironically this might actually fix it for you

    "
     _____ _   _  _____ _______       _      _      
    |_   _| \ | |/ ____|__   __|/\   | |    | |     
      | | |  \| | (___    | |  /  \  | |    | |     
      | | | . ` |\___ \   | | / /\ \ | |    | |     
     _| |_| |\  |____) |  | |/ ____ \| |____| |____ 
    |_____|_| \_|_____/   |_/_/    \_\______|______|
    
      _____ ______ _   _ _______ ____   ____  
     / ____|  ____| \ | |__   __/ __ \ / __ \ 
    | |  __| |__  |  \| |  | | | |  | | |  | |
    | | |_ |  __| | . ` |  | | | |  | | |  | |
    | |__| | |____| |\  |  | | | |__| | |__| |
     \_____|______|_| \_|  |_|  \____/ \____/ 
    "
    
    Off-Topic

  • LiquidLauncher w/ unmet dependencies
    C commandblock2

    @estiar-flynd
    https://github.com/CCBlueX/LiquidLauncher/issues/7
    You might need to compile it yourself or somehow pack the .deb yourself.
    Or you could just use an alternative launcher like MultiMC5 or launch from Intellij Idea.

    avetharun created this issue in CCBlueX/LiquidLauncher

    closed [BUG] Debian/Linux archive has typo in dependency: libgconf2-4 #7

    General ubuntu dependancy liquidlauncher

  • help
    C commandblock2

    net/minecraft/network/NetHandlerPlayServer.java:414
    (mcp 918)
    Either keep gliding or touch the ground in every 80 C03 packets that has less 0.0.03125D in y than the previous packet. Gliding will not increase the counter. Touching the ground reset the counter to 0.
    I also wonder why vanillakickbypass doesn't work on some server (in my case server where version > 1.8).

    ScriptAPI

  • teleport hit
    C commandblock2

    @IdkWhoMe he's saying that tpback option should be added. The original tphit send C04 to tp to the enemy and then send a attack, so the player is around the enemy. He wanted it to teleport back to the original position.

    Suggestions

  • [Guide] Typescript definition for Minecraft and LiquidBounce
    C commandblock2

    Update: now the script will also print the embedded context made available by the script api

    // Import required Java classes
    
    // type: array
    /** @type any[]*/
    var globalEntries = Object.entries(this);
    
    const System = Java.type("java.lang.System");
    const URLClassLoader = Java.type("java.net.URLClassLoader");
    const File = Java.type("java.io.File");
    const URL = Java.type("java.net.URL");
    const Thread = Java.type("java.lang.Thread");
    const Paths = Java.type("java.nio.file.Paths");
    const Map = Java.type("java.util.HashMap");
    const ArrayList = Java.type("java.util.ArrayList");
    const JvmClassMappingKt = Java.type("kotlin.jvm.JvmClassMappingKt");
    const Class = Java.type("java.lang.Class");
    
    // Function to create a URLClassLoader from a JAR path
    function createClassLoaderFromJar(jarPath) {
        try {
            // Create File object for the JAR
            const jarFile = new File(jarPath);
    
            // Convert File to URL
            const jarUrl = jarFile.toURI().toURL();
    
            // Create URLClassLoader with the system class loader as parent
            return new URLClassLoader(
                [jarUrl],
                Thread.currentThread().getContextClassLoader()
            );
        } catch (e) {
            console.error("Error creating ClassLoader:", e);
            throw e;
        }
    }
    
    // Function to load a class from a given ClassLoader
    function loadClassFromJar(classLoader, className) {
        try {
            return classLoader.loadClass(className);
        } catch (e) {
            console.error(`Error loading class ${className}:`, e);
            throw e;
        }
    }
    
    const script = registerScript({
        name: "for-repl",
        version: "1.0.0",
        authors: ["commandblock2"],
    });
    
    script.registerModule(
        {
            name: "for-repl",
            category: "Client",
            description: "Sausage",
            settings: {
                path: Setting.text({
                    name: "Path",
                    default:
                        "/mnt/old-linux/home/commandblock2/git_repo/MultiMC5/build/instances/LBNG-Production/minecraft/LiquidBounce/scripts",
                }),
                packageName: Setting.text({
                    name: "NPMPackageName",
                    default: "minecraft-yarn-definitions",
                }),
            },
        },
        (mod) => {
            mod.on("enable", (event) => {
                const loader = createClassLoaderFromJar(
                    mod.settings.path.value + "/ts-generator-1.0.0.jar"
                );
                const NPMGen = loadClassFromJar(
                    loader,
                    "me.commandblock2.tsGenerator.NPMPackageGenerator"
                );
                const TsGen = loadClassFromJar(
                    loader,
                    "me.ntrrgc.tsGenerator.TypeScriptGenerator"
                );
                const VoidType = loadClassFromJar(
                    loader,
                    "me.ntrrgc.tsGenerator.VoidType"
                );
                const NULL = VoidType.getEnumConstants()[0];
    
                const javaClasses = globalEntries
                    .filter((entry) => entry[1] != undefined)
                    .map((entry) => (entry[1] instanceof Class ? entry[1] : entry[1].class))
                    .filter((entry) => entry != undefined);
    
                const kotlinClasses = javaClasses.map((entry) =>
                    JvmClassMappingKt.getKotlinClass(entry)
                );
    
                const classes = new ArrayList(kotlinClasses);
    
                try {
                    const generated = new TsGen(
                        classes,
                        new Map(),
                        new ArrayList(),
                        new ArrayList(),
                        "number",
                        NULL
                    );
                    const npmPack = new NPMGen(generated, mod.settings.packageName.value);
                    npmPack.writePackageTo(
                        Paths.get(mod.settings.path.value + "/types-gen")
                    );
    
                    const embeddedDefinition = `
    // imports
    ${javaClasses
                            .map((clazz) => {
                                return `import { ${clazz.simpleName} } from "@${mod.settings.packageName.value}/types/${clazz.name.replaceAll(".", "/")}";`;
                            })
                            .join("\n")}
    
    
    // definitions for objects
    ${globalEntries
                            .filter((entry) => entry[1] != undefined)
                            .filter((entry) => !(entry[1] instanceof Class))
                            .filter((entry) => entry[1].class != undefined)
                            .map((entry) => `export var ${entry[0]}: ${entry[1].class.simpleName};`)
                            .join("\n\n")}
    
    `;
                    console.log(embeddedDefinition)
                } catch (e) {
                    e.printStackTrace();
                    console.error(e);
                    throw e;
                }
    
                // ReflectionUtil.invokeMethod(mc.player, "getName")
                // event.context.drawGuiTexture(RenderLayer.getGuiTextured, CLOSE_TEXTURE, 0, 0, 16, 16, -1);
            });
        }
    );
    
    
    Scripts

  • help
    C commandblock2

    @idkmyname
    JDK is basically a superset of JRE.

    In simple words, JDK is something for writing programs, while JRE is something for running those java programs. (of course a JDK will also allows you to run a Java program)

    JDK -> Java Development Kit
    JRE -> Java Runtime Environment

    To do something LiquidBounce developing related thing you need to have JDK installed.

    To determine if you have a JDK installed, navigate to

    C:\Program Files\Java\
    

    And see if there is a folder for JDK exist (for example jdk1.8.0_251 instead of jre..... )

    If you don't have JDK installed, then install one, I don't remember if any extra steps like registering a oracle account is needed on windows currently.

    Then you modify the JAVA_HOME variable to the the JDK path. After that it should work.

    General
  • Login

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups