ScriptAPI

Getting Started

Info The documentation on this website only refers to the latest version of the script API, which was introduced in LiquidBounce b72. All new scripts should use it. However, if you need the old documentation, you can still find it in this GitHub repository. ScriptManag...

Using Java Classes

Java classes Since, as mentioned in the introduction, Nashorn is able to access Java classes directly, it is possible to solve most problems with the script API almost exactly as one would do in Java. For this purpose, a method is used that is provided by Nashorn itself. It allows the developer to i...

Registering a Script

Scripts Each script has to be manually registered with the client before beginning to create modules, commands or inventory tabs. For this purpose the ScriptAPI has a global method to which some information about the script must also be passed. This method is registerScript. Registering a script The...

Global Classes

Chat The Chat class simplifies interacting with the Minecraft Chat. Method Summary Chat.print(text) Prints the passed string client-side in the chat. List of arguments: text, the string to be printed to the chat. Example: Chat.print("Axolotl") Setting The Setting class allows the creation of modu...

Global Instances

mc mc contains the Minecraft instance (Minecraft.getMinecraft()) It is the most important instance in every script. It can be used to do almost any manipulation desired to the game. Instead of listing all available methods and fields here, we refer to the Minecraft JavaDocs, which can also be found ...

Creating Modules

Creating Commands

ScriptAPI commands Commands created with the script API can be executed just like regular commands. Compared to modules, they are especially useful when a particular action is to be performed only once and not continuously. Creating a command script.registerCommand(options, callback) Each command ha...

Creating Inventory Tabs

ScriptAPI inventory tabs LiquidBounce has a secondary inventory that can be accessed in creative mode. It contains useful items, but also items that can be used to exploit in-game bugs. With the ScriptAPI it is also possible to add additional tabs with your own items. Creating a tab script.registerT...

Setting up Babel

Setting up Babel When writing scripts for LiquidBounce's ScriptAPI, you are restricted by the fact that Nashorn, the script engine used, only supports JavaScript up to version ES5. In other words, many features that were introduced in newer revisions of the language are not natively supported by th...