Skip to content

ScriptAPI

A place to ask for help on writing scripts

306 Topics 2.2k Posts
  • Methods with the same name but different arguments possibly causing issues

    Unsolved
    3
    0 Votes
    3 Posts
    60 Views
    AjaxA

    Thanks for the reply. Honestly, good point about making an issue on GitHub, I dunno how that hasn't crossed my mind lol. Here's a link to my issue https://github.com/CCBlueX/LiquidBounce/issues/4964.

    ayaxdev created this issue in CCBlueX/LiquidBounce open [BUG] #4964
  • TargetControll

    Unsolved
    1
    0 Votes
    1 Posts
    121 Views
    No one has replied
  • networking stuff with hypixel api

    Unsolved
    1
    0 Votes
    1 Posts
    118 Views
    No one has replied
  • get armor of facing entity

    Unsolved
    1
    0 Votes
    1 Posts
    192 Views
    No one has replied
  • Accessing non-class kotlin functions

    Solved
    2
    0 Votes
    2 Posts
    177 Views
    K

    I figured it out, lol. Just have to do

    Java.type("net.ccbluex.liquidbounce.utils.aiming.RotationFindingKt");

    a.k.a.: add [filename]Kt at the end of the type cause that's just how Kotlin works.

  • 0 Votes
    2 Posts
    211 Views
    kawaiinekololisK

    If you are trying to use the script on Nextgen, it has to be updated to function. C03PacketPlayer named like this only exists on the 1.8.9 forge mappings, so it was created for Legacy.

  • Help with GUIs

    Unsolved
    2
    0 Votes
    2 Posts
    184 Views
    H

    you can use fabric api to click on an item in the GUI.

  • Hey

    Unsolved
    4
    0 Votes
    4 Posts
    219 Views
    EclipsesDevE

    @HieuNamYT wdym by packet codes? like C08 or smth like that?

  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • massive performance issues

    Unsolved
    1
    0 Votes
    1 Posts
    130 Views
    No one has replied
  • Help With Fixing Code

    Unsolved
    11
    1 Votes
    11 Posts
    397 Views
    IgniteTNTI

    It doesn't seem to like mc.gameSettings.keyBindSneak.pressed works, weird.

  • Sneak Packet

    Unsolved
    1
    0 Votes
    1 Posts
    146 Views
    No one has replied
  • Help With Liquidbounce Nextgen ScriptingAPI

    Unsolved
    1
    0 Votes
    1 Posts
    141 Views
    No one has replied
  • I need script velogrimC07(apiv2)

    Unsolved
    3
    0 Votes
    3 Posts
    259 Views
    kawaiinekololisK

    Use LiquidBounce Nextgen instead. It already features Grim Velocity.

  • mc.thePlayer is undefined

    Unsolved
    5
    0 Votes
    5 Posts
    480 Views
    182exe1

    @kawaiinekololis
    this is what prints if I'm just asking for mc.thePlayer

    [15:58:47] [Client thread/INFO]: [CHAT] undefined
    [15:58:47] [Client thread/INFO]: [CHAT] undefined
    [15:58:47] [Client thread/INFO]: [CHAT] undefined
    [15:58:47] [Client thread/INFO]: [CHAT] undefined
    [15:58:47] [Client thread/INFO]: [CHAT] undefined

    and if i query mc.thePlayer.motionX for example:
    [16:00:49] [Client thread/ERROR]: [ScriptAPI] Exception in module 'MMC Velocity'!
    jdk.nashorn.internal.runtime.ECMAException: TypeError: Cannot read property "motionX" from undefined
    at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57) ~[ECMAErrors.class:?]
    at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:213) ~[ECMAErrors.class:?]
    at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:185) ~[ECMAErrors.class:?]
    at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:172) ~[ECMAErrors.class:?]
    at jdk.nashorn.internal.runtime.Undefined.get(Undefined.java:157) ~[Undefined.class:?]
    at jdk.nashorn.internal.scripts.Script$Recompilation$23$293$^eval_.L:12#L:13(<eval>:14) ~[?:?]
    at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637) ~[ScriptFunctionData.class:?]
    at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494) ~[ScriptFunction.class:?]
    at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393) ~[ScriptRuntime.class:?]
    at jdk.nashorn.api.scripting.ScriptObjectMirror.call(ScriptObjectMirror.java:117) ~[ScriptObjectMirror.class:?]
    at net.ccbluex.liquidbounce.script.api.ScriptModule.callEvent(ScriptModule.kt:122) [ScriptModule.class:?]
    at net.ccbluex.liquidbounce.script.api.ScriptModule.callEvent$default(ScriptModule.kt:120) [ScriptModule.class:?]
    at net.ccbluex.liquidbounce.script.api.ScriptModule.onUpdate(ScriptModule.kt:62) [ScriptModule.class:?]
    at sun.reflect.GeneratedMethodAccessor115.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51]
    at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51]
    at net.ccbluex.liquidbounce.event.EventManager.callEvent(EventManager.kt:53) [EventManager.class:?]
    at net.minecraft.client.entity.EntityPlayerSP.func_70636_d(EntityPlayerSP.java:1103) [bew.class:?]
    at net.minecraft.entity.EntityLivingBase.func_70071_h_(EntityLivingBase.java:1614) [pr.class:?]
    at net.minecraft.entity.player.EntityPlayer.func_70071_h_(EntityPlayer.java:283) [wn.class:?]
    at net.minecraft.client.entity.EntityPlayerSP.func_70071_h_(EntityPlayerSP.java:117) [bew.class:?]
    at net.minecraft.world.World.func_72866_a(World.java:1862) [adm.class:?]
    at net.minecraft.world.World.func_72870_g(World.java:1831) [adm.class:?]
    at net.minecraft.world.World.func_72939_s(World.java:1663) [adm.class:?]
    at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:2089) [ave.class:?]
    at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1024) [ave.class:?]
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:349) [ave.class:?]
    at net.minecraft.client.main.Main.main(SourceFile:124) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51]
    at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]

  • Scripting api works for new gen? I can’t find it anywhere

    Unsolved
    5
    0 Votes
    5 Posts
    311 Views
    kawaiinekololisK

    The PR was merged, let me know if there is something missing.

    Documentation will follow soon.

  • Unsure how to fix script issue

    Unsolved
    3
    0 Votes
    3 Posts
    255 Views
    FaaatPotatoF

    @FaaatPotato Actually it is too cool to not be used. So I included your way of doing it and you can whitelist items via text setting

    ///api_version=2 (script = registerScript({ name: "DepositFish", version: "1.0", authors: ["some fisherman"] })); var GuiChest = Java.type("net.minecraft.client.gui.inventory.GuiChest"), ItemFish = Java.type("net.minecraft.item.ItemFishFood") script.registerModule({ name: "DepositFish", category: "Misc", description: "Stores fish lol", settings: { modeValue: mode = Setting.list({ name: "Mode", values: ["FaaatPotato", "ToolTip"], default: "FaaatPotato" }), itemsValue: items = Setting.text({ name: "ItemsToStore", default: "fish", isSupported: function() { return mode.get() == "ToolTip" } }) } }, function (module) { module.on("update", function() { if (mc.currentScreen instanceof GuiChest) { var inventoryContainer = Java.from(mc.thePlayer.inventoryContainer.getInventory()) var openContainer = Java.from(mc.thePlayer.openContainer.getInventory()) if (mode.get() == "FaaatPotato") { var fishSlots = inventoryContainer.filter(function (stack) stack && stack.getItem() instanceof ItemFish/*|| you can add more items here, you need to import them*/) fishSlots.length && fishSlots.forEach(function (stack) mc.playerController.windowClick(mc.thePlayer.openContainer.windowId, openContainer.indexOf(stack), 0, 1, mc.thePlayer)); } if (mode.get() == "ToolTip") { var itemsToStore = items.get().toLowerCase().split(",") var itemSlots = inventoryContainer.filter(function (stack) stack && itemsToStore.some(function (itemName) Java.from(stack.getTooltip(mc.thePlayer, true)).toString().toLowerCase().contains(itemName))) itemSlots.length && itemSlots.forEach(function (stack) mc.playerController.windowClick(mc.thePlayer.openContainer.windowId, openContainer.indexOf(stack), 0, 1, mc.thePlayer)) } } }); });

    just make sure to type the whole item name in the text field so no similar items will be put in the storage
    e.g.
    .depositfish itemstostore diamond_sword,fishing_rod,fish

    however this could lead to issues if names contain for example fish as in fishing_rod. Thats why you checked for != contains("rod"). But that should be solvable for you.

  • In the future b100

    Unsolved
    2
    0 Votes
    2 Posts
    234 Views
    G

    @moon It seems as if you don't have a single clue about what you're saying, and it also seems as if you're using Google Translate. Anyway, it is highly unlikely that LiquidBounce legacy will use another ScriptAPI, as this one is already pretty good for what it does, and can create actually quite complex scripts.

  • how to put a delay between things

    Solved
    3
    0 Votes
    3 Posts
    244 Views
    _

    @Plumer-Man tried that but it clips 2.5 blocks for some reason

  • rotationAngleX not returning angle of given player instance

    Unsolved
    1
    0 Votes
    1 Posts
    141 Views
    No one has replied