ScriptAPI

A place to ask for help on writing scripts

295 Topics 2.2k Posts
  • Help With Fixing Code

    Unsolved
    9
    1 Votes
    9 Posts
    100 Views

    What is the syntax for tick events?

  • Help With Liquidbounce Nextgen ScriptingAPI

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

    Unsolved
    3
    0 Votes
    3 Posts
    115 Views

    Use LiquidBounce Nextgen instead. It already features Grim Velocity.

  • mc.thePlayer is undefined

    Unsolved
    5
    0 Votes
    5 Posts
    298 Views

    @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
    130 Views

    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
    148 Views

    @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
    120 Views

    @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
    131 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
    76 Views
    No one has replied
  • I dont have ANY idea why this script is broken.

    Unsolved
    4
    0 Votes
    4 Posts
    206 Views

    @CzechHek

    🗣️🗣️🗣️🗣️🔥 some1 needs to add own little utils to ScriptAPI

  • displayable in values

    Unsolved
    8
    0 Votes
    8 Posts
    161 Views

    @CzechHek So, it has to be redone?

  • help

    5
    0 Votes
    5 Posts
    191 Views

    @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
    4 Posts
    146 Views

    @Marlon no problem homie

  • How to use various utils, such as rotationutils

    Unsolved
    2
    0 Votes
    2 Posts
    91 Views

    @ybyyby_-awa I really don't understand what to add INSTANCE to. I haven't checked for updates lately

  • 0 Votes
    1 Posts
    105 Views
    No one has replied
  • [TUTORIAL] How to deobfuscate (most) scripts on this forum

    Unsolved
    5
    3 Votes
    5 Posts
    650 Views

    @Aftery XD
    can you try deobfuscating it?

  • [API Demonstrate] Packet_Var

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

    Unsolved
    2
    0 Votes
    2 Posts
    105 Views

    @nam-nguyen
    When would it disable? After a certain amount of ticks? After a teleport (s08)?

  • How to reference api interface through lbScript

    Unsolved
    2
    0 Votes
    2 Posts
    67 Views