Skip to content

ScriptAPI

A place to ask for help on writing scripts

316 Topics 2.3k Posts
  • massive performance issues

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

    Unsolved
    11
    1 Votes
    11 Posts
    2k Views
    IgniteTNTI
    It doesn't seem to like mc.gameSettings.keyBindSneak.pressed works, weird.
  • Sneak Packet

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

    Unsolved
    1
    0 Votes
    1 Posts
    343 Views
    No one has replied
  • mc.thePlayer is undefined

    Unsolved
    5
    0 Votes
    5 Posts
    1k 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
    1k 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
    757 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
    1k 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
    684 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
    333 Views
    No one has replied
  • I dont have ANY idea why this script is broken.

    Unsolved
    4
    0 Votes
    4 Posts
    914 Views
    FaaatPotatoF
    @CzechHek ️️️️ some1 needs to add own little utils to ScriptAPI
  • displayable in values

    Unsolved
    8
    0 Votes
    8 Posts
    1k Views
    G
    @CzechHek So, it has to be redone?
  • help

    5
    0 Votes
    5 Posts
    986 Views
    FaaatPotatoF
    @DreamWasFucked despite the fact that you are banned, this might still be interesting: mc.getRenderItem().renderItemAndEffectIntoGUI(ItemStack, x, y); This worked for me. Haven't found this one on this forum yet. Maybe it helps somebody. and if you want to get rid of some shade when rendering blocks RenderHelper = Java.type("net.minecraft.client.renderer.RenderHelper"); RenderHelper.enableGUIStandardItemLighting() mc.getRenderItem().renderItemIntoGUI(stack, x, y); mc.getRenderItem().renderItemOverlays(mc.fontRendererObj, stack, x, y) RenderHelper.disableStandardItemLighting();
  • Why I can't use commandManager or moduleManager in my script

    Unsolved
    6
    0 Votes
    6 Posts
    2k Views
    kawaiinekololisK
    @isnotpuppy Put this tag on the top of your script: /// api_version=2 ... code This will fix the issue. See: https://liquidbounce.net/docs/ScriptAPI/Getting Started Also fixed in future versions by removing support for ScriptAPI v1: https://github.com/CCBlueX/LiquidBounce/commit/3e92903f1372e1c96225bca057f0f136928d3bd5 0 1zun4 committed to CCBlueX/LiquidBounce removed support for ScriptAPI v1 Please update your script to ScriptAPI v2 to avoid issues in the future. See https://liquidbounce.net/docs/ScriptAPI/Getting%20Started for further information. This change fixes module and command manager not being defined correctly. See https://forums.ccbluex.net/topic/7671/why-i-can-t-use-commandmanager-or-modulemanager-in-my-script/
  • [Unnicker] How to get the Textures / Property of the GameProfile of a Player

    Solved
    4
    0 Votes
    4 Posts
    761 Views
    FaaatPotatoF
    @Marlon no problem homie
  • How to use various utils, such as rotationutils

    Unsolved
    2
    0 Votes
    2 Posts
    472 Views
    ybyyby_ awaY
    @ybyyby_-awa I really don't understand what to add INSTANCE to. I haven't checked for updates lately
  • 0 Votes
    1 Posts
    340 Views
    No one has replied
  • [TUTORIAL] How to deobfuscate (most) scripts on this forum

    Unsolved
    5
    3 Votes
    5 Posts
    2k Views
    I
    @Aftery XD can you try deobfuscating it?
  • [API Demonstrate] Packet_Var

    Unsolved
    1
    0 Votes
    1 Posts
    253 Views
    No one has replied
  • pls give me script autodisable fly pls :(

    Unsolved
    2
    0 Votes
    2 Posts
    483 Views
    Plumer ManP
    @nam-nguyen When would it disable? After a certain amount of ticks? After a teleport (s08)?