### Keyboard and Initialization Event Handlers Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/jsmacros/client/mixins/access/MixinScreen Sets up keyboard event handlers and initialization/failure callbacks for the screen. ```APIDOC ## POST /websites/jsmacros_wagyourtail_xyz/keyboardAndInitEvents ### Description Sets up keyboard event handlers and initialization/failure callbacks for the screen. ### Method POST ### Endpoint /websites/jsmacros_wagyourtail_xyz/keyboardAndInitEvents ### Parameters #### Request Body - **onKeyPressed** (MethodWrapper) - Optional - Callback for key press events. - **onCharTyped** (MethodWrapper) - Optional - Callback for character typed events. - **onInit** (MethodWrapper) - Optional - Callback for successful screen initialization. - **catchInit** (MethodWrapper) - Optional - Callback for screen initialization failure. - **onClose** (MethodWrapper) - Optional - Callback for screen close events. ### Response #### Success Response (200) - **IScreen** - The screen object after setting the event handlers. #### Response Example ```json { "IScreen": "..." } ``` ``` -------------------------------- ### Get Slider Initial Value Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/jsmacros/client/api/helpers/screen/SliderWidgetHelper Retrieves the initial value set for the slider. Returns an integer representing the starting value. ```java getValue() ``` -------------------------------- ### ItemStackHelper: Get Item Properties Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/jsmacros/client/api/helpers/inventory/ItemStackHelper Provides examples for retrieving various properties of an item stack, such as its name, count, NBT data, and item ID. Note that some methods are deprecated. ```java itemStackHelper.getName(); itemStackHelper.getCount(); itemStackHelper.getNBT(); itemStackHelper.getItemID(); // Deprecated itemStackHelper.getItemId(); ``` -------------------------------- ### ServiceListTopbar Methods - Java Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/jsmacros/client/gui/containers/ServiceListTopbar Contains methods for initializing and rendering the ServiceListTopbar GUI component. 'init' sets up the component, and 'render' draws it to the screen with mouse interaction handling. ```Java public void init() public void render(DrawContext drawContext, int mouseX, int mouseY, float delta) ``` -------------------------------- ### FRequest - GET Request Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/jsmacros/core/library/impl/FRequest Sends a GET request to a specified URL with optional headers. Retrieves data from the given URL. ```APIDOC ## GET /frequest/get ### Description Sends a GET request to the specified URL. ### Method GET ### Endpoint /frequest/get ### Parameters #### Query Parameters - **url** (String) - Required - The URL to send the GET request to. - **headers** (Map) - Optional - A map of headers to include in the request. ### Request Example ```json { "url": "http://example.com/data", "headers": { "Authorization": "Bearer token" } } ``` ### Response #### Success Response (200) - **status** (Integer) - The HTTP status code of the response. - **body** (String) - The response body as a string. - **headers** (Map) - A map of the response headers. #### Response Example ```json { "status": 200, "body": "{\"message\": \"Success\"}", "headers": { "Content-Type": "application/json" } } ``` ``` -------------------------------- ### ConfirmOverlay Constructors Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/wagyourgui/overlays/ConfirmOverlay Provides information on how to create instances of ConfirmOverlay using its various constructors. ```APIDOC ## ConfirmOverlay Constructors ### Constructor 1 Creates a new ConfirmOverlay instance. ### Method `new ConfirmOverlay()` ### Parameters #### Path Parameters - **x** (int) - Required - The x-coordinate for the overlay. - **y** (int) - Required - The y-coordinate for the overlay. - **width** (int) - Required - The width of the overlay. - **height** (int) - Required - The height of the overlay. - **textRenderer** (TextRenderer) - Required - The text renderer to use. - **message** (Text) - Required - The message to display in the overlay. - **parent** (IOverlayParent) - Required - The parent overlay. - **accept** (Consumer) - Required - The callback for confirmation. ### Request Example ```json { "example": "new ConfirmOverlay(x, y, width, height, textRenderer, message, parent, accept)" } ``` ### Constructor 2 Creates a new ConfirmOverlay instance with horizontal centering. ### Method `new ConfirmOverlay()` ### Parameters #### Path Parameters - **x** (int) - Required - The x-coordinate for the overlay. - **y** (int) - Required - The y-coordinate for the overlay. - **width** (int) - Required - The width of the overlay. - **height** (int) - Required - The height of the overlay. - **hcenter** (boolean) - Required - Whether to horizontally center the content. - **textRenderer** (TextRenderer) - Required - The text renderer to use. - **message** (Text) - Required - The message to display in the overlay. - **parent** (IOverlayParent) - Required - The parent overlay. - **accept** (Consumer) - Required - The callback for confirmation. ### Request Example ```json { "example": "new ConfirmOverlay(x, y, width, height, hcenter, textRenderer, message, parent, accept)" } ``` ``` -------------------------------- ### Main Method Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/jsmacros/client/api/helpers/PacketByteBufferHelper Entry point for the application. Accepts string array arguments. ```APIDOC ## POST /websites/jsmacros_wagyourtail_xyz/main ### Description Entry point for the application. Accepts string array arguments. ### Method POST ### Endpoint /websites/jsmacros_wagyourtail_xyz/main #### Request Body - **args** (String[]) - Optional - Command-line arguments. ### Response #### Success Response (200) - **message** (string) - Indicates the main method has been executed. #### Response Example ```json { "message": "Main method executed." } ``` ``` -------------------------------- ### Slot and Container Details Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/jsmacros/client/api/classes/inventory/Inventory Functions to get detailed information about specific slots and the container itself. This includes retrieving an ItemStackHelper for a given slot, getting the total number of slots, and determining the type of inventory. ```javascript inventory.getSlot(slot) inventory.getTotalSlots() inventory.getType() inventory.is(types) inventory.getContainerTitle() inventory.getSlotUnderMouse() inventory.getLocation(slotNum) inventory.getSlotPos(slot) ``` -------------------------------- ### Get Packet Name Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/jsmacros/client/api/helpers/PacketByteBufferHelper Retrieves the name of a given packet. ```APIDOC ## POST /websites/jsmacros_wagyourtail_xyz/packet/name ### Description Retrieves the name of a given packet. ### Method POST ### Endpoint /websites/jsmacros_wagyourtail_xyz/packet/name #### Request Body - **packet** (Packet) - Required - The packet object. ### Response #### Success Response (200) - **packet_name** (String) - The name of the packet. #### Response Example ```json { "packet_name": "ExamplePacketName" } ``` ``` -------------------------------- ### JsMacros Client Initialization and Fields Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/jsmacros/client/JsMacros Details on the JsMacros client initialization methods and static fields available. ```APIDOC ## JsMacros Client API ### Description This section covers the core client-side functionalities of JsMacros, including initialization and access to key fields. ### Fields #### `.MOD_ID` - **Type:** String - **Static:** Yes - **Final:** Yes - **Description:** The unique identifier for the JsMacros mod. #### `.LOGGER` - **Type:** Logger - **Static:** Yes - **Final:** Yes - **Description:** The logger instance for JsMacros. #### `.keyBinding` - **Type:** KeyBinding - **Static:** Yes - **Description:** The key binding associated with JsMacros. #### `.prevScreen` - **Type:** BaseScreen - **Static:** Yes - **Description:** Stores the previously active screen. #### `.core` - **Type:** Core - **Static:** Yes - **Final:** Yes - **Description:** The core JsMacros instance managing profiles and event registries. ### Methods #### `.onInitialize()` - **Static:** Yes - **Returns:** void - **Description:** Called during the mod initialization phase. #### `.onInitializeClient()` - **Static:** Yes - **Returns:** void - **Description:** Called specifically during client-side initialization. ``` -------------------------------- ### Mouse Event Handlers Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/jsmacros/client/mixins/access/MixinScreen Sets up various mouse event handlers for the screen. ```APIDOC ## POST /websites/jsmacros_wagyourtail_xyz/mouseEvents ### Description Sets up various mouse event handlers for the screen. ### Method POST ### Endpoint /websites/jsmacros_wagyourtail_xyz/mouseEvents ### Parameters #### Request Body - **onMouseDown** (MethodWrapper) - Optional - Callback for mouse down events. - **onMouseDrag** (MethodWrapper) - Optional - Callback for mouse drag events. - **onMouseUp** (MethodWrapper) - Optional - Callback for mouse up events. - **onScroll** (MethodWrapper) - Optional - Callback for scroll events. ### Response #### Success Response (200) - **IScreen** - The screen object after setting the event handlers. #### Response Example ```json { "IScreen": "..." } ``` ``` -------------------------------- ### Rectangle Get Z-Index Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/jsmacros/client/api/classes/render/components/Rect Retrieves the current z-index of the rectangle. ```APIDOC ## Rect .getZIndex() ### Description Retrieves the current z-index of the rectangle. ### Method GET ### Endpoint /websites/jsmacros_wagyourtail_xyz/rect/{id}/zIndex ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the rectangle. ### Response #### Success Response (200) - **zIndex** (int) - The current z-index of the rectangle. #### Response Example ```json { "zIndex": 5 } ``` ``` -------------------------------- ### TextPrompt Fields and Methods Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/wagyourgui/overlays/TextPrompt Provides details on the fields and methods available for the TextPrompt overlay, including initialization and rendering logic. ```APIDOC ## TextPrompt Fields and Methods ### Description Details the available fields and methods for interacting with a TextPrompt instance, including its associated TextInput and rendering logic. ### Methods #### init() ##### Description Initializes the TextPrompt overlay. This method should be called after the overlay is created. ##### Method `init()` ##### Endpoint N/A (Method) ##### Parameters None ##### Request Example ```js prompt.init(); ``` ##### Returns: `void` #### render(drawContext, mouseX, mouseY, delta) ##### Description Renders the TextPrompt overlay on the screen. This method is called by the JsMacros rendering system. ##### Method `render(drawContext, mouseX, mouseY, delta)` ##### Endpoint N/A (Method) ##### Parameters - **drawContext** (DrawContext) - Required - The context for drawing. - **mouseX** (int) - Required - The current x-coordinate of the mouse. - **mouseY** (int) - Required - The current y-coordinate of the mouse. - **delta** (float) - Required - The time elapsed since the last frame. ##### Request Example ```js // This method is typically called internally by JsMacros // prompt.render(drawContext, mouseX, mouseY, delta); ``` ##### Returns: `void` ### Fields #### .ti ##### Description Provides access to the underlying TextInput component of the TextPrompt. ##### Type `TextInput` ##### Endpoint N/A (Field) ##### Request Example ```js const textInput = prompt.ti; // Interact with textInput as needed ``` ``` -------------------------------- ### Retrieving All Elements Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/StringHashTrie Method to get all elements stored in the trie. ```APIDOC ### `getAll()` Returns all elements contained within the StringHashTrie as a Set. ##### Returns: `Set` - A set containing all elements in the trie. ``` -------------------------------- ### ArrowEntityHelper Methods Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/jsmacros/client/api/helpers/world/entity/specialized/projectile/ArrowEntityHelper Provides methods to get information about an arrow entity. ```APIDOC ## ArrowEntityHelper API ### Description This API provides methods to interact with arrow entities, allowing you to retrieve specific properties and states of an arrow. ### Methods #### `.getColor()` ##### Description Gets the particle color of the arrow. ##### Returns: - `int`: The particle's color of the arrow, or -1 if the arrow has no particles. #### `.isCritical()` ##### Description Checks if the arrow will deal critical damage. ##### Returns: - `boolean`: `true` if the arrow will deal critical damage, `false` otherwise. #### `.getPiercingLevel()` ##### Description Gets the piercing level of the arrow. This is relevant only if the arrow was fired from a crossbow with the piercing enchantment. ##### Returns: - `int`: The piercing level of the arrow. #### `.isShotFromCrossbow()` ##### Description Checks if the arrow was shot from a crossbow. ##### Returns: - `boolean`: `true` if the arrow is shot from a crossbow, `false` otherwise. ``` -------------------------------- ### ConfirmOverlay Methods Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/wagyourgui/overlays/ConfirmOverlay Documentation for the methods available in the ConfirmOverlay class. ```APIDOC ## ConfirmOverlay Methods ### Method: `setMessage` Sets the message to be displayed in the overlay. ### Parameters #### Path Parameters - **message** (Text) - Required - The new message to display. ### Returns void ### Method: `init` Initializes the overlay. ### Returns void ### Method: `render` Renders the overlay. ### Parameters #### Path Parameters - **drawContext** (DrawContext) - Required - The drawing context. - **mouseX** (int) - Required - The current mouse x-coordinate. - **mouseY** (int) - Required - The current mouse y-coordinate. - **delta** (float) - Required - The time delta since the last frame. ### Returns void ``` -------------------------------- ### RecipeHelper Constructor Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/jsmacros/client/api/helpers/inventory/RecipeHelper Initializes a new instance of the RecipeHelper class. ```APIDOC ## new RecipeHelper(base, syncId) ### Description Initializes a new instance of the RecipeHelper class. ### Method CONSTRUCTOR ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **base** (RecipeEntry) - Required - Description of the base recipe entry. - **syncId** (int) - Required - Description of the synchronization ID. ``` -------------------------------- ### Rectangle Get Parent Height Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/jsmacros/client/api/classes/render/components/Rect Retrieves the height of the parent element. ```APIDOC ## int .getParentHeight() ### Description Retrieves the height of the parent element. ### Method GET ### Endpoint /websites/jsmacros_wagyourtail_xyz/rect/{id}/parentHeight ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the rectangle. ### Response #### Success Response (200) - **parentHeight** (int) - The height of the parent element. #### Response Example ```json { "parentHeight": 400 } ``` ``` -------------------------------- ### Initialization and Rendering Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/jsmacros/client/api/classes/render/Draw2D Provides methods for initializing the drawing context and rendering the scene. ```APIDOC ## Drawing Context API ### Description Provides methods for initializing the drawing context and rendering the scene. ### Methods #### init() ##### Description Initializes the drawing context. ##### Returns void #### render(drawContext) ##### Description Renders the scene using the provided draw context. ##### Parameters - **drawContext** (DrawContext) - The context for drawing. ##### Returns void #### getElementsByZIndex() ##### Description Retrieves elements sorted by their z-index. ##### Returns (Type not specified, likely an array of elements) ``` -------------------------------- ### Rectangle Get Scaled Height Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/jsmacros/client/api/classes/render/components/Rect Retrieves the scaled height of the rectangle. ```APIDOC ## int .getScaledHeight() ### Description Retrieves the scaled height of the rectangle. ### Method GET ### Endpoint /websites/jsmacros_wagyourtail_xyz/rect/{id}/scaledHeight ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the rectangle. ### Response #### Success Response (200) - **scaledHeight** (int) - The scaled height of the rectangle. #### Response Example ```json { "scaledHeight": 150 } ``` ``` -------------------------------- ### TextDisplayEntityHelper$TextDisplayDataHelper Constructor Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/jsmacros/client/api/helpers/world/entity/specialized/display/TextDisplayEntityHelper Initializes a new TextDisplayEntityHelper$TextDisplayDataHelper. ```APIDOC ## new TextDisplayEntityHelper$TextDisplayDataHelper(base) ### Description Initializes a new instance of TextDisplayEntityHelper$TextDisplayDataHelper. ### Method Constructor ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **base** (DisplayEntity$TextDisplayEntity$Data) - Required - The base data for the text display entity. ### Request Example ```json { "base": { ... } } ``` ### Response #### Success Response (200) This is a constructor, no direct response body. #### Response Example N/A ``` -------------------------------- ### Rectangle Get Parent Width Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/jsmacros/client/api/classes/render/components/Rect Retrieves the width of the parent element. ```APIDOC ## int .getParentWidth() ### Description Retrieves the width of the parent element. ### Method GET ### Endpoint /websites/jsmacros_wagyourtail_xyz/rect/{id}/parentWidth ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the rectangle. ### Response #### Success Response (200) - **parentWidth** (int) - The width of the parent element. #### Response Example ```json { "parentWidth": 500 } ``` ``` -------------------------------- ### EventEXPChange Constructor Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/jsmacros/client/api/event/impl/player/EventEXPChange Initializes a new instance of the EventEXPChange class with detailed player experience information. ```APIDOC ## Constructor EventEXPChange ### Description Initializes a new instance of the EventEXPChange class. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "progress": 100.5, "total": 200, "level": 5, "prevProgress": 50.2, "prevTotal": 100, "prevLevel": 4 } ``` ### Response #### Success Response (200) None (Constructor) #### Response Example None ``` -------------------------------- ### Rectangle Get Scaled Width Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/jsmacros/client/api/classes/render/components/Rect Retrieves the scaled width of the rectangle. ```APIDOC ## int .getScaledWidth() ### Description Retrieves the scaled width of the rectangle. ### Method GET ### Endpoint /websites/jsmacros_wagyourtail_xyz/rect/{id}/scaledWidth ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the rectangle. ### Response #### Success Response (200) - **scaledWidth** (int) - The scaled width of the rectangle. #### Response Example ```json { "scaledWidth": 200 } ``` ``` -------------------------------- ### Get Parent Dimensions Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/jsmacros/client/api/classes/render/components/Item Retrieves the width and height of the parent item. ```APIDOC ## Get Parent Dimensions ### Description Provides methods to retrieve the width and height of the parent item associated with the current object. ### Method N/A (Assumed to be method calls within a class) ### Endpoint N/A ### Parameters None for these specific getter methods. ### Request Example ```javascript // Example usage (assuming 'this' refers to the object) const parentWidth = this.getParentWidth(); const parentHeight = this.getParentHeight(); ``` ### Response #### Success Response (200) - **getParentWidth()**: Returns an `int` representing the parent's width. - **getParentHeight()**: Returns an `int` representing the parent's height. #### Response Example ```json // Example response for getParentWidth() { "parentWidth": 200 } ``` ``` -------------------------------- ### CoreConfigV2 Constructors and Fields Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/jsmacros/core/config/CoreConfigV2 Details on how to instantiate CoreConfigV2 and access its configuration fields. ```APIDOC ## CoreConfigV2 Class ### Description Provides access to core configuration settings for JsMacros, including profile management, service triggers, and ignored elements. ### Constructors #### `new CoreConfigV2()` Creates a new instance of the `CoreConfigV2`. ### Fields #### `.maxLockTime` - **Type**: `long` - **Description**: The maximum time in milliseconds a lock can be held. #### `.defaultProfile` - **Type**: `String` - **Description**: The name of the default profile to be used. #### `.anythingIgnored` - **Type**: `List` - **Description**: A list of strings representing elements that should be ignored. #### `.profiles` - **Type**: `Map>` - **Description**: A map where keys are profile names and values are lists of script triggers associated with that profile. #### `.services` - **Type**: `Map` - **Description**: A map where keys are service names and values are `ServiceTrigger` objects. ``` -------------------------------- ### TextInput Constructor and Methods Source: https://jsmacros.wagyourtail.xyz/1.9.2/xyz/wagyourtail/wagyourgui/elements/TextInput Documentation for the TextInput element's constructor, fields, and methods. ```APIDOC ## xyz.wagyourtail.wagyourgui.elements.TextInput ### Description Represents a text input field within the JsMacros GUI system. It extends the Button class and provides functionality for text rendering, input handling, and selection. ### Constructor #### new TextInput(x, y, width, height, textRenderer, color, borderColor, highlightColor, textColor, message, onClick, onChange) **Parameters:** - **x** (int) - The x-coordinate of the text input. - **y** (int) - The y-coordinate of the text input. - **width** (int) - The width of the text input. - **height** (int) - The height of the text input. - **textRenderer** (TextRenderer) - The text renderer to use for displaying text. - **color** (int) - The background color of the text input. - **borderColor** (int) - The border color of the text input. - **highlightColor** (int) - The highlight color when the text input is focused. - **textColor** (int) - The color of the text. - **message** (String) - The initial message or placeholder text. - **onClick** (Consumer