Important for new members!
All future posts from members with a reputation of less than 1 will be queued for manual review to prevent forum spam. We will review your posts as soon as possible!
RotationUtils.INSTANCE.setTargetRotation在legacy b97中应该怎么用?
我从之前的js里找到了RotationUtils.INSTANCE.setTargetRotation方法,但无法加载到b97。js源码如下:
How to use “RotationUtils.INSTANCE.setTargetRotation” in Legacy B97? I found the ”RotationUtils.INSTANCE.setTargetRotation“ method from an old JS script, but it cannot be loaded in B97.The following are some details:[image: 1738489082387-c1deb05f-f4ad-43d5-9de1-a4cbead2c12a-image.png]
如果可能的话,请提供一个如何使用正确内容或方法的示例,谢谢!
If possible, please provide an example of how to use the correct content or method, thank you!
Update: Experimental Support For ScriptAPI
minecraft-LBNG-types
This repo contains
instruction and scripts for creating
typescript definitions for Minecraft (with mods*)
typescript definitions for LiquidBounce NextGen
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)
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. But the following example already works(tested)
[image: 1738500020404-vscode-file___vscode-app_opt_vscodium_resources_app_out_vs_code_electron-sandbox_workbench_workbench.html-cropped.png]
See also: This amazing plugin that colors each (member)variable to different colors similar to KDevelop
Original:
[image: 1737821165003-42599a43-bc16-4e5d-a167-6c5091874c3a-image.png]
Typescript definition for minecraft and LiquidBounce (and virtually every mod installed plus java/kotlin infrustructure). The definitions will not be uploaded for potential legal risks (Although I don't really think that would be a violation or smth, I am not lawyer tho, just trying to be safe from distributing the game). See the demo video.
link to the video
But
it must be launched from the development environment to generate the definition(for now, will change if I decide to use the remapper or someone else whoever want to make it work can try.)
there are ofc many nuances not dealt with (typescript -> graaljs).
there is not yet a fully working project that can convert this to a script that LB compatible js (convert the import for certain prefixes to Java.type()"
source mapping for the previous process
it cannot properly deal with graaljs integration (implicit conversions for sometimes), Any | null | any and something like that.
Other problems with kotlin reflection vs java reflection but idk about those undiscovered traps.
This is a demo just for showing what is possible, certainly not as good as you think it is
Resources:
Download the ts-generator(FOSS, GPLv3 and Apache 2.0 dual licensed) and extract the zip, or ofc build the jar yourself. create a types-gen folder at the same path, modify the path in the script. Or read the script and support yourself, whatever.
The script for generating the definition:
// Import required Java classes
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');
// 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"
}, (mod) => {
mod.on("enable", (event) => {
if (!mc.player || !mc.world)
return;
// This is working but lags a lot
// The following will be fixed in this pr
loader = createClassLoaderFromJar('/path/tots-generator-1.0.0.jar')
NPMGen = loadClassFromJar(loader, "me.commandblock2.tsGenerator.NPMPackageGenerator")
NPMGenKt = loadClassFromJar(loader, "me.commandblock2.tsGenerator.NPMPackageGeneratorKt")
TsGen = loadClassFromJar(loader, "me.ntrrgc.tsGenerator.TypeScriptGenerator")
VoidType = loadClassFromJar(loader, "me.ntrrgc.tsGenerator.VoidType")
NULL = VoidType.getEnumConstants()[0]
Map = Java.type("java.util.HashMap")
ArrayList = Java.type("java.util.ArrayList")
JvmClassMappingKt = Java.type('kotlin.jvm.JvmClassMappingKt');
kClass = JvmClassMappingKt.getKotlinClass(Client.class);
classes = new ArrayList([kClass]);
try {
generated = new TsGen(classes, new Map(), new ArrayList(), new ArrayList(), "number", NULL);
npmPack = new NPMGen(generated, "minecraft-yarn-definitions");
npmPack.writePackageTo(Paths.get("/path/totypes-gen"));
console.log(generated);
} 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);
})
});
gamsterFull.txt
.binds list for keybinds (hold grave for F*cker)
dont use eagle, i was just testing it.
NOTE: alot of this is from the Polar AC Public Config, but I tailored this so it is a bit nicer for Gamster
enjoy
INSTRUCTIONS:
Lob the file into ur NEXTGEN configs and rename it to "name.json" (currently its a .txt)
Author: mumy
Introduction
Since LiquidBounce switched its ScriptAPI language to JavaScript from version b57, it has provided powerful extensibility. However, the community has not conducted a specific performance evaluation on it. Recently, I realized this gap and decided to perform a simple benchmark to assess its performance.
Test
I plan to divide the scripts into two categories: Standard Scripts and Hybrid Scripts (e.g., mumyPacketDebugger). The tests will include Fibonacci numbers, the Sieve of Eratosthenes, and block scanning in the world. For the Nextgen version, tests will be conducted using ZuluJDK and GraalVM.
The final result will be based on the shortest time taken after the runtime stabilizes.
Script
Benchmark for legacy b99 and nextgen 0.24.zip
Platform
OS: Windows 10 22H2
CPU: Intel i9-14900HX (locked at 5.0GHz)
RAM: DDR5 16GB + 16GB 5600MHz
Environment
Legacy
Version: b99
JDK: ZuluJDK 8
Minecraft: Forge 1.8.9 + OptiFine M5
Nextgen
Version: 0.24
JDK: ZuluJDK 21 / GraalVM 21
Minecraft: Fabric 1.21.4 + Sodium 0.6.6
Results
Legacy
Test Case
Fibonacci
Sieve of Eratosthenes
World Scanner
Standard Script
149ms
61482ms
1539ms
Hybrid Script
59ms
1147ms
311ms
Nextgen
Test Case
Fibonacci
Sieve of Eratosthenes
World Scanner
Standard Script + ZuluJDK
9890ms
9629ms
9368ms
Standard Script + GraalVM
144ms
1277ms
1952ms
Hybrid Script + ZuluJDK
67ms
1023ms
195ms
Hybrid Script + GraalVM
52ms
982ms
177ms
Conclusion
There are some special versions of LiquidBounce that I haven't tested, but most of them are outdated and have limited reference value (e.g., Legacy-b73 1.12.2 or Nextgen 0.17, which didn't yet support GraalJS JIT).
For the Legacy version, since Nashorn has been used as the Script engine since b57, theoretically, there are no significant performance differences across versions.
For Nextgen, if you don't use GraalVM to launch LiquidBounce, you may experience lag when running standard scripts. I recommend using LiquidLauncher to solve this issue.
Hi Guys,
i recently dived into custom scripts and i would like that the player drops the current main hand slot i have tried already multiple things from different forums and also tried to do my own research in this "fabric" (yarn) library and on the "documentation" of LB but i just cant figure it out if you could help me with that it would be very nice.
Thank you in advance,
DeScrupter
Author : mumy
Description
Used to fix the synchronization issue in ClickGUI after the introduction of Cache.
Issue: https://github.com/CCBlueX/LiquidBounce/issues/5228
Download
ClickGUISyncer 0.1.zip (Compatible with Nextgen 0.21-0.23 (may be fixed in 0.24))
mumy-255 created this issue in CCBlueX/LiquidBounce
closed
[BUG] ClickGUI malfunction
#5228
So i just installed liquidbounce, left everything as is, clicked launch, waited, and then an error message popped up like this:
[image: 1736313573973-c7472479-4705-4749-8f17-9362c9b30961-image.png]
(it already includes my information so no need to type it in)
the log: https://paste.ccbluex.net/2a6c44b40
i have no idea how to fix this so please help me out
作者:mumy
前言
LiquidBounce自从b57时把ScriptAPI的语言更换到JavaScript后提供了强大的扩展性,但社区中并未对其性能进行过较为具体的评估。
最近我才意识到了这个情况,所以我打算尝试做个简易的Benchmark以评估其性能。
测试
我计划将脚本分为两类:标准脚本和混合脚本(例如 mumyPacketDebugger)。
测试将包括斐波那契数、埃氏质数筛选和世界(方块)扫描。
对于 Nextgen 版本,我分别使用 ZuluJDK 与 GraalVM 进行测试。
最终结果将取决于运行时间稳定后的最短耗时。
脚本
legacy b99 和 nextgen 0.24 的 Benchmark.zip
测试平台
操作系统:Windows 10 22H2
CPU:Intel i9-14900HX(锁频 5.0GHz)
内存:DDR5 16GB + 16GB 5600MHz
测试环境
Legacy
版本:b99
JDK:ZuluJDK 8
Minecraft:Forge 1.8.9 + OptiFine M5
Nextgen
版本:0.24
JDK:ZuluJDK 21 / GraalVM 21
Minecraft:Fabric 1.21.4 + Sodium 0.6.6
测试结果
Legacy
测试项目
斐波那契数
埃氏质数筛
世界扫描
标准脚本
149ms
61482ms
1539ms
混合脚本
59ms
1147ms
311ms
Nextgen
测试项目
斐波那契数
埃氏质数筛
世界扫描
标准脚本 + ZuluJDK
9890ms
9629ms
9368ms
标准脚本 + GraalVM
144ms
1277ms
1952ms
混合脚本 + ZuluJDK
67ms
1023ms
195ms
混合脚本 + GraalVM
52ms
982ms
177ms
结论
虽然有一些特殊版本的 LiquidBounce 我并未测试,但大多数都是过时版本,参考价值有限(例如 Legacy-b73 1.12.2 或 Nextgen 0.17,后者尚未支持 GraalJS JIT)。
对于 Legacy 版本,自 b57 以来一直使用 Nashorn 作为脚本引擎,理论上每个版本的性能差异不大。
对于 Nextgen 版本,如果没有使用 GraalVM 启动 LiquidBounce,在运行标准脚本时可能会出现卡顿现象。推荐使用 LiquidLauncher 来解决这个问题。
-
-
-
-
General Discussion
A place to talk about anything related to LiquidBounce
-
Suggestions
Think something is missing? Let us know!
-
Bug Reports
Found a bug? Report it here!
-
Chinese
A place for our Chinese community
-
Off-Topic
Talk about anything you like (as long as you follow the rules)!