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

TypeNameDescriptionSignature

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 [Novoline] prefix

void(string)

field

features

object collection

field

tasks

object collection

field

connection

object collection

field

user

object collection

field

directories

object collection

field

notifications

object collection

field

render

object collection

field

utils

object collection

field

fonts

Fonts API

object collection

Feature API

TypeNameDescriptionSignature

function

register

Registers a new Feature

Feature(string, string)

function

getByName

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.

TypeNameDescriptionSignature

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:

client.tasks.createFutureTask(1000 /* delay in ms */, {
    execute: function() { /* ... */ },
    run: function() { /* ... */ }
});

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.

TypeNameDescriptionSignature

function

sendPacket

Sends a Serverbound Packet

void(object)

function

sendPacketNoEvent

Sends a Serverbound Packet, and doesn't fire a PacketSendEvent

void(object)

Examples:

client.connection.sendPacket(new C01PacketChatMessage('Hello')); // using macros
client.connection.sendPacketNoEvent({ packetId: 0x01, message: 'Hello' });

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.

TypeNameDescriptionSignature

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.

TypeNameDescriptionSignature

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.

TypeNameDescriptionSignature

function

push

Shows a new Notification

void(object)

Parameters for the Notification object are as follows:

{
    type: 'info' // info, warning, error, success
    text: 'Notification Title' // title - optional, if not present replaced by localized type
    subText: 'Notification Content' // content, required
    duration: 500 // duration in ms, how long the notification will be shown
}

Rendering API

Provides access to Renderers and Transitions.

TypeNameDescriptionSignature

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:

var renderer = client.render.createRenderer('ColoredPolygonRenderer');

renderer.putRoundedRect(
    /* x */ 20, 
    /* y */ 20, 
    /* w */ 5, 
    /* h */ 5, 
    /* rad */ 2.5, 
    /* col */ rgb(255, 200, 100));
    
renderer.draw();

Transitions

Transitions are wrappers around easing functions, that allow you to create beautiful animations. Example usage:

var tr = client.render.createTransition();

feature.on('enable', Priorities.NORMAL, function() {
    tr.start({ start: 10, end: 50, duration: 1000, type: 'cubic_in_out' });
});

feature.on('renderScreen', Priorities.NORMAL, function() {
    var x = 20.0 + tr.update().getValue();
    var y = 20.0;

    client.utils.render.drawRect(x, y, x + 5.0, y + 5.0, -1);
});

Utilities API

Provides access to other Utilities.

NameDescription

Item Enchantments Utilities

ItemStack Utilities

Math Helpers

Player Utilities

Combat, Rotation Utilities

Linear Animation Utilities

Server Identity Utilities

Rendering Utilities

Enchantment API

TypeNameDescriptionSignature

function

getToolScore

Returns the total Tool score for ItemStack

int(ItemStack)

function

getMaterialScore

Returns the total Material score for its name (EMERALD, DIAMOND, IRON, STONE, GOLD, WOOD)

int(string)

function

getArmorScore

Returns the total Armor score for ItemStack

int(ItemStack)

Inventory API

TypeNameDescriptionSignature

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

TypeNameDescriptionSignature

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

TypeNameDescriptionSignature

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

TypeNameDescriptionSignature

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

TypeNameDescriptionSignature

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.

TypeNameDescriptionSignature

function

serverIs

Whether the Client is connected to a specific game server (acceptable values: hypixel)

boolean(string)

function

hypixelGamemodeIs

Whether the User is playing a specific Hypixel game mode

boolean(string)

Acceptable Hypixel game modes
  1. unknown (Default state)

  2. lobby

  3. pre_game (In cage)

  4. arcade

  5. arena_brawl

  6. bed_wars

  7. blitz_survival_games

  8. blocking_dead

  9. bounty_hunters

  10. build_battle

  11. capture_the_wool

  12. cops_and_crims

  13. creeper_attack

  14. duels

  15. farm_hunt

  16. football

  17. galaxy_wars

  18. hide_and_seek

  19. hole_in_the_wall

  20. housing

  21. hypixel_says

  22. mega_walls

  23. mini_walls

  24. murder_mystery

  25. paintball

  26. party_games

  27. quakecraft

  28. sky_block

  29. sky_wars

  30. speed_uhc

  31. super_smash

  32. the_pit

  33. the_walls

  34. throw_out

  35. tnt_games

  36. tower_wars

  37. turbo_kart_racers

  38. uhc

  39. vampire_z

  40. warlords

  41. zombies

Render API

TypeNameDescriptionSignature

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 glColor4f(1.0, 1.0, 1.0, 1.0)

void()

function

setupColor

Calls glColor4f with the given color

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:

var renderer = client.fonts.createFontRenderer(
    fontName /* (1) */, 
    fontSize /* (2) */);
  1. The font's internal name. You can only use Fonts, that are listed below.

  2. Font size, any integer number.

List of supported fonts

Font nameDescriptionWeight

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

TypeNameDescriptionSignature

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

TypeNameDescriptionSignature

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