Client API
NovoScript provides access to various Client APIs via the client global variable. From there you can create Features, send Packets and access many other utility functions.
Top-level members
Type | Name | Description | Signature |
---|---|---|---|
field | name | Client name | string |
field | version | Client version | string |
field | build | Client build date | string |
field | channel | Client release channel | string |
function | getLanguage | Returns the current active language's code | string() |
function | clientChatMessage | Sends a message to the player's chat, with the | void(string) |
field | features | Feature API | object collection |
field | tasks | FutureTask API | object collection |
field | connection | Connection API | object collection |
field | user | User Data API | object collection |
field | directories | object collection | |
field | notifications | Notifications API | object collection |
field | render | Rendering API | object collection |
field | utils | Utilities API | object collection |
field | fonts | Fonts API | object collection |
Feature API
Type | Name | Description | Signature |
---|---|---|---|
function | register | Registers a new Feature | Feature(string, string) |
function | getByName | Looks up a Feature by its name | Feature(string) |
FutureTask API
FutureTasks are scheduled pieces of code, that are ran with a specific delay. Whether this delay has been passed, or not, is checked on every TickUpdateEvent (every 0.05s), so be aware of that.
Type | Name | Description | Signature |
---|---|---|---|
function | createFutureTask | Creates and schedules a new FutureTask | void(int, object) |
In [1] entry of the table above, in the 2nd argument, you need to supply an object with overrides for the FutureTask object. Example:
Execute function runs when the delay has passed. Run function runs on every TickUpdateEvent until the delay passes. You can either supply one of them, or both, but you can't supply none of them.
Connection API
You can use the Connection API to send Packets to the connected game server.
Type | Name | Description | Signature |
---|---|---|---|
function | sendPacket | Sends a Serverbound Packet | void(object) |
function | sendPacketNoEvent | Sends a Serverbound Packet, and doesn't fire a PacketSendEvent | void(object) |
Examples:
In this example we're using Minecraft API macros, which allow you to create various Game Objects, including Packets. It's much easier to use and it's cross-compatible with Vanilla Minecraft code.
User Data API
Provides access to the currently authenticated User's data.
Type | Name | Description | Signature |
---|---|---|---|
field | uid | User's ID | string |
field | username | User's Username | string |
Directories API
Provides access to the Client's working directories via the Java NIO API.
Type | Name | Description | Signature |
---|---|---|---|
field | root | Root Folder | java.nio.file.Path |
field | storage | Storage Folder in Root | java.nio.file.Path |
field | scripts | Scripts Folder in Root | java.nio.file.Path |
Notifications API
Allows you to show Notifications in the UI.
Type | Name | Description | Signature |
---|---|---|---|
function | push | Shows a new Notification | void(object) |
Parameters for the Notification object are as follows:
Rendering API
Provides access to Renderers and Transitions.
Type | Name | Description | Signature |
---|---|---|---|
function | createRenderer | Creates a new Renderer. | Renderer(string, object) |
function | createTransition | Creates a new Transition. | Transition() |
Renderers
Renderers allow you to draw many things at once, without requiring using glBegin
/glEnd
multiple times, thus improving performance. Example usage:
Transitions
Transitions are wrappers around easing functions, that allow you to create beautiful animations. Example usage:
Utilities API
Provides access to other Utilities.
Name | Description |
---|---|
Item Enchantments Utilities | |
ItemStack Utilities | |
Math Helpers | |
Player Utilities | |
Combat, Rotation Utilities | |
Linear Animation Utilities | |
Server Identity Utilities | |
Rendering Utilities |
Enchantment API
Type | Name | Description | Signature |
---|---|---|---|
function | getToolScore | Returns the total Tool score for ItemStack | int(ItemStack) |
function | getMaterialScore | Returns the total Material score for its name ( | int(string) |
function | getArmorScore | Returns the total Armor score for ItemStack | int(ItemStack) |
Inventory API
Type | Name | Description | Signature |
---|---|---|---|
function | findEmptyHotbarSlot | Returns the first empty hotbar slot, -1 if none are empty | int() |
function | findSlotWithBlocks | Returns the first slot with blocks, -1 if none | int(boolean) |
function | findBestArmorSlot | Returns the best slot for armor, -1 if none | int() |
Math Helpers
Type | Name | Description | Signature |
---|---|---|---|
function | sinerp | Smoothstep (args: min, max, intervalMs) | decimal(decimal, decimal, int) |
function | sinerp | Smoothstep with offset (args: min, max, offset, intervalMs) | decimal(decimal, decimal, decimal, int) |
Player API
Type | Name | Description | Signature |
---|---|---|---|
function | getLastTickDistance | Returns distance traveled since last game tick | decimal() |
function | getBaseMoveSpeed | Returns player's base move speed | decimal() |
function | getBaseMoveSpeed | Returns player's base move speed, multiplied | decimal(decimal) |
function | getBaseMoveSpeed | Returns player's base move speed, multiplied and amplified | decimal(decimal, int) |
function | isMoving | Whether the player is moving | boolean() |
function | getDirection | Returns player's direction yaw for movement input | decimal() |
function | setMotionSpeed | Sets player's speed | void(decimal) |
function | setSpeed | Sets player's speed with strafe | void(decimal) |
function | isBlockUnder | Whether there's a block below player | boolean() |
function | isReallyOnGround | If the block below player is not a liquid or air, returns the player's ground state, otherwise false | boolean() |
function | isOnGround | Whether the player, offset by a specific Y, is on ground | boolean(decimal) |
function | isOnGround | Whether an entity, offset by a specific Y, is on ground | boolean(decimal, Entity) |
function | isInsideBlock | Whether the player is currently inside a block | boolean() |
function | isInLiquid | Whether the player is currently in a liquid | boolean() |
function | isOnLiquid | Whether the player is currently standing on a liquid | boolean() |
function | isVoidBelow | Whether a set of coordinates point to void | boolean(decimal, decimal, decimal) |
function | teamColor | Returns the entity player's team color | string(EntityPlayer) |
function | isSameTeam | Whether two entity players are on the same team | boolean(EntityPlayer, EntityPlayer) |
function | getBaseMotionY | Returns the player's base motion Y | decimal() |
function | getBaseMotionY | Returns adjusted motion Y for potion effects | decimal(decimal) |
function | clonePlayer | Returns a clone of the player | EntityPlayer() |
Combat/Rotation API
Type | Name | Description | Signature |
---|---|---|---|
function | getRotationsToEntity | Returns an array of the yaw, pitch rotations to an entity (args: target, currentYaw, currentPitch) | decimal[](EntityLivingBase, decimal, decimal) |
function | getRotationsToEntity | Returns an array of the yaw, pitch rotations to an entity, randomized (args: target, currentYaw, currentPitch, randomize) | decimal[](EntityLivingBase, decimal, decimal, boolean) |
function | getRotations | Returns an array of the yaw, pitch rotations to a point (args: x, y, z) | decimal[](decimal, decimal, decimal) |
function | getRotationsToBlock | Returns an array of the yaw, pitch rotations to a block | decimal[](Vec3) |
function | getRotationsToBlock | Returns an array of the yaw, pitch rotations to a block (args: vec, enumFacing, center) | decimal[](Vec3, EnumFacing, boolean) |
function | getVectorForRotation | Returns a Vec3 for yaw, pitch rotations | Vec3(decimal, decimal) |
function | updateRotation | Updates rotations (args: angle, targetAngle, maxIncrease) | decimal(decimal, decimal, decimal) |
function | getMovementYaw | Returns a yaw to the player's strafe/forward inputs | decimal() |
function | getYawToPoint | Returns a yaw to the x, z coordinates (args: posX, posZ) | decimal(decimal, decimal) |
function | rayTrace | Raytrace blocks from an entity (args: from, reach, yaw, pitch) | MovingObjectPosition(Entity, decimal, decimal, decimal) |
function | rayTraceEntities | Raytrace entities from an entity (args: from, reach, yaw, pitch) | MovingObjectPosition(Entity, decimal, decimal, decimal) |
Linear Animation API
Type | Name | Description | Signature |
---|---|---|---|
function | animate | Linearly animates a value (args: reference, finalState, speed) | decimal(decimal, decimal, decimal) |
function | animate | Animates a value, with increasing speed (args: reference, finalState, speed, minSpeed) | decimal(decimal, decimal, decimal, decimal) |
function | updateDelta | Updates global-tracking variable for last frame time. Doesn't need to be called by the user | void() |
Server Identity API
Allows you to check which Server the Player's currently on, and which game mode are they playing.
Type | Name | Description | Signature |
---|---|---|---|
function | serverIs | Whether the Client is connected to a specific game server (acceptable values: | boolean(string) |
function | hypixelGamemodeIs | Whether the User is playing a specific Hypixel game mode | boolean(string) |
Render API
Type | Name | Description | Signature |
---|---|---|---|
function | fixedBlendFunc | Fixed tryBlendFuncSeparate for Client Shaders | void() |
function | createFramebuffer | Creates a new Framebuffer, if the previous one, supplied as an argument, doesn't match with the current window resolution | Framebuffer(Framebuffer) |
function | drawFramebuffer | Draws the Framebuffer's result on the screen | void(Framebuffer, ScaledResolution) |
function | drawFullScreenRect | Draws a bound texture on the screen | void(ScaledResolution) |
function | drawRect | Draws a rectangle on the screen (args: x, y, x2, y2, color) | void(decimal, decimal, decimal, decimal, int) |
function | drawBorderedRect | Draws a rectangle with an outside border on the screen (args: x, y, x2, y2, thickness, insideCol, outlineCol) | void(decimal, decimal, decimal, decimal, decimal, int, int) |
function | drawScaledCustomSizeRect | Draws the bound texture (args: x, y, u, v, uWidth, vHeight, width, height, tileWidth, tileHeight) | void(decimal, decimal, decimal, decimal, decimal, decimal, decimal, decimal, decimal, decimal) |
function | drawImage | Binds and draws an image on the screen (args: x, y, width, height, color, imageResource) | void(decimal, decimal, decimal, decimal, integer, ResourceLocation) |
function | drawCirclePerecnt | Draws a circle on the screen (args: x, y, radius, lineWidth, color, percent) | void(decimal, decimal, decimal, decimal, int, int) |
function | drawCirclePercent | Draws a circle on the screen (args: x, y, radius, lineWidth, color, percent, astolfo) | void(decimal, decimal, decimal, decimal, int, int, boolean) |
function | drawGradientRect | Draws a gradient rectangle on the screen (args: left, top, right, bottom, upColor, downColor) | void(decimal, decimal, decimal, decimal, int, int) |
function | drawGradientRectSideways | Draws a gradient rectangle on the screen (args: left, top, right, bottom, leftColor, rightColor) | void(decimal, decimal, decimal, decimal, int, int) |
function | drawRainbowCircle | Draws a rainbow circle on the screen (args: x, y, radius, quality) | void(decimal, decimal, decimal, int) |
function | drawModalRectWithCustomSizedTexture | Draws a textured rectangle at z = 0 (args: x, y, u, v, width, height, texWidth, texHeight) | void(decimal, decimal, decimal, decimal, decimal, decimal, decimal, decimal) |
function | drawTexturedModalRect | Draws a textured rectangle (args: x, y, texX, texY, width, height, atlasSize) | void(decimal, decimal, decimal, decimal, decimal, decimal, int) |
function | drawTexturedModalRect | Draws a textured rectangle with atlasSize = 256 (args: x, y, texX, texY, width, height) | void(decimal, decimal, decimal, decimal, decimal, decimal) |
function | translateColorAnimated | Interpolates a color (args: currentColor, endColor, speed) | void(int, int, decimal) |
function | withAlpha | Adds alpha to color (args: color, alpha) | int(int, int) |
function | resetColor | Calls | void() |
function | setupColor | Calls | void(int) |
function | hexToColor | Breaks a hex color into 4 parts (r, g, b, a) | decimal[](int) |
function | hexToColor10 | Breaks a hex color into 4 parts, with values varying from 0.0 to 1.0 | decimal[](int) |
function | colorToHex | Converts a rgba color array to hex | int(decimal[]) |
function | rainbowColor | Returns a rainbow color (args: index, count, saturation, brightness, cycleTime) | int(int, int, decimal, decimal, long) |
function | rainbowColor | Returns a rainbow color (args: progress, saturation, brightness, cycleTime) | int(decimal, decimal, decimal, long) |
function | astolfoColor | Returns an Astolfo client-like color (args: index, count, saturation, brightness, cycleTime) | int(int, int, decimal, decimal, long) |
function | astolfoColor | Returns an Astolfo client-like color (args: progress, saturation, brightness, cycleTime) | int(decimal, decimal, decimal, long) |
function | interpolateColor | Interpolates two colors (args: col1, col2, percent) | int(int, int, decimal) |
function | gradientColor | Returns a gradient color (args: col1, col2, index, count, cycleTime) | int(int, int, int, int, long) |
function | fadeColor | Returns a fading color (args: col, min, max, index, count, cycleTime) | int(int, decimal, decimal, int, int, long) |
function | drawGradientLine | Draws a gradient line on the screen (args: x, y, x2, y2, lineWidth, col1, col2, smooth) | void(decimal, decimal, decimal, decimal, decimal, int, int, boolean) |
function | drawShadow | Draws a shadow on the screen (args: x1, y1, x2, y2, width, color) | void(decimal, decimal, decimal, decimal, decimal, int) |
function | scissorStart | Starts a scissor-box (args: x, y, width, height) | void(int, int, int, int) |
function | scissorEnd | Ends a scissor-box | void() |
function | worldToScreen | Translates world coordinates (3D) into screen coordinates (2D) | decimal[](Vec3) |
function | worldToScreen | Translates world coordinates (3D) into screen coordinates (2D) (args: x, y, z) | decimal[](decimal, decimal, decimal) |
function | drawLine | Draws a line on the screen (args: x, y, x2, y2, color) | void(decimal, decimal, decimal, decimal, int) |
function | drawLine | Draws a line on the screen (args: x, y, x2, y2, color, smooth) | void(decimal, decimal, decimal, decimal, int, boolean) |
function | drawLine | Draws a line on the screen (args: x, y, x2, y2, lineWidth, color, smooth) | void(decimal, decimal, decimal, decimal, decimal, int, boolean) |
function | enableOutlineMode | Set a custom color for the current rendered model | void(int) |
function | disableOutlineMode | Disable coloring for the current rendered model | void() |
function | drawSelectionBoundingBox | Draws a selection box around an AxisAlignedBB (args: box, r, g, b, a) | void(AxisAlignedBB, decimal, decimal, decimal, decimal) |
function | renderFilledBox | Draws a filled 3D box (args: box, r, g, b, a) | void(AxisAlignedBB, decimal, decimal, decimal, decimal) |
function | drawSelectionBox | Draws a selection box around an AxisAlignedBB (args: box, color). Doesn't allow alpha channel | void(AxisAlignedBB, int) |
function | drawFilledBox | Draws a filled 3D box (args: box, color). Doesn't allow alpha channel and also draws an outline | void(AxisAlignedBB, int) |
Fonts API
NovoScript provides support for builtin Client fonts. To start rendering with the Fonts, you need to create a FontRenderer first:
The font's internal name. You can only use Fonts, that are listed below.
Font size, any integer number.
List of supported fonts
Font name | Description | Weight |
---|---|---|
RubikRegular | Primary Client Font | 400 |
RubikSemibold | Primary Client Font | 600 |
PixelRegular | Minecraft Rus | 400 |
RobotoRegular | Roboto | 400 |
MontserratRegular | Montserrat | 400 |
MuseoSansMedium | Museo Sans (Neverlose) | 500 |
MuseoSansBold | Museo Sans (Neverlose) | 700 |
MuseoSansBlack | Museo Sans (Neverlose) | 900 |
Font Renderer Object
Type | Name | Description | Signature |
---|---|---|---|
function | getFont | Returns the Java AWT font object | java.awt.Font() |
function | getHeight | Returns the font height | int() |
function | isAntiAlias | Whether anti-aliasing is enabled | boolean() |
function | getStringWidth | Returns the width of the text | int(string) |
function | wrapWords | Moves words to the next line if the line width exceeds some number | List<String>(string, double) |
function | formatString | Same as wrapWords, but preserves the color codes | List<String>(string, double) |
function | drawString | Draw a string on the screen | void(object) |
field | imgSize | Glyphs amount in the texture | int |
field | tex | Glyphs texture | DynamicTexture |
drawString Properties
Type | Name | Description | Signature |
---|---|---|---|
field | mode | Rendering mode, one of: regular, with_shadow, centered, centered_with_shadow, nice_shadow, nice_shadow_no_color | string |
field | text | Text to be rendered | string |
field | x | Text's X position | decimal |
field | y | Text's Y position | decimal |
field | color | Text's hex color | int |
Here's a visualization of the rendering modes:
Modes "Centered" and "Centered with Shadow" can be useful when displaying the text in a centered area. They automagically adjust your text by subtracting half the width of the text from the X position.
Last updated