problem with nextgen scriptapi
-
const C06PacketPlayerPosLook = Java.type("net.minecraft.network.play.client.C03PacketPlayer.C06PacketPlayerPosLook"); const S08PacketPlayerPosLook = Java.type("net.minecraft.network.play.server.S08PacketPlayerPosLook"); const lastMotionX = 0.0; const lastMotionY = 0.0; const lastMotionZ = 0.0; const pendingFlagApplyPacket = false; const script = registerScript({ name: "matrixdisabler", version: "1.0.0", authors: ["developer"] }); script.registerModule({ name: "matrixnoslow", category: "Misc", // Movement, Combat, Render, ... description: "xz che" }, (mod) => { mod.on("disable", () => { pendingFlagApplyPacket = false; }); mod.on("packet", (event) => { const packet = event.getPacket; if (packet instanceof C06PacketPlayerPosLook && pendingFlagApplyPacket ) { pendingFlagApplyPacket = false; mc.thePlayer.motionX = lastMotionX; mc.thePlayer.motionY = lastMotionY; mc.thePlayer.motionZ = lastMotionZ; } else if (packet instanceof S08PacketPlayerPosLook ) { pendingFlagApplyPacket = true lastMotionX = mc.thePlayer.motionX; lastMotionY = mc.thePlayer.motionY; lastMotionZ = mc.thePlayer.motionZ; } }); });
giving error in logs
[21:35:55] [Render thread/ERROR]: Unable to load script example.js.
org.graalvm.polyglot.PolyglotException: ReferenceError: "Java" is not defined
at <js>.:program(example.js:1) ~[?:?]
at org.graalvm.polyglot.Context.eval(Context.java:403) ~[LiquidBounce.jar:?]
at net.ccbluex.liquidbounce.script.Script.initScript(Script.kt:89) ~[LiquidBounce.jar:?]
at net.ccbluex.liquidbounce.script.ScriptManager.loadScript(ScriptManager.kt:87) ~[LiquidBounce.jar:?]
at net.ccbluex.liquidbounce.script.ScriptManager.loadSafely(ScriptManager.kt:77) ~[LiquidBounce.jar:?]
at net.ccbluex.liquidbounce.script.ScriptManager.loadScripts(ScriptManager.kt:60) ~[LiquidBounce.jar:?]
at net.ccbluex.liquidbounce.LiquidBounce$startHandler$1.invoke(LiquidBounce.kt:154) ~[LiquidBounce.jar:?]
at net.ccbluex.liquidbounce.LiquidBounce$startHandler$1.invoke(LiquidBounce.kt:111) ~[LiquidBounce.jar:?]
at net.ccbluex.liquidbounce.event.EventManager.callEvent(EventManager.kt:173) ~[LiquidBounce.jar:?]
at net.minecraft.class_310.handler$bmh000$liquidbounce$startClient(class_310.java:9347) ~[client-intermediary.jar:?]
at net.minecraft.class_310.<init>(class_310.java:675) ~[client-intermediary.jar:?]
at net.minecraft.client.main.Main.main(Main.java:223) ~[fabric-loader-0.15.3-1.20.4.jar:?]
at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470) ~[fabric-loader-0.15.3.jar:?]
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) ~[fabric-loader-0.15.3.jar:?]
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) ~[fabric-loader-0.15.3.jar:?]
[To redirect Truffle log output to a file use one of the following options:- '--log.file=<path>' if the option is passed using a guest language launcher.
- '-Dpolyglot.log.file=<path>' if the option is passed using the host Java launcher.
- Configure logging using the polyglot embedding API.]
[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation.
The guest application code will therefore be executed in interpreted mode only.
Execution only in interpreted mode will strongly impact the guest application performance.
For more information on using GraalVM see https://www.graalvm.org/java/quickstart/.
To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property.
-
I think you're using NextGen version, the nextgen version using fabric so the path of packets are different, you should take a look here: MavenFabric