ClientAPI

A global API used to interact with the current Minecraft client
Most of its functions return things that can be found in the F3 menu

ClientAPI.getVersion

Example by ChloeSpacedOut:
Returns the Minecraft version of your client
overload 1:
client.getVersion()
Method Property Fluent Description Representation
Return Value a String

ClientAPI.getDate

Returns a table with information about the client's current time
overload 1:
client.getDate()
Method Property Fluent Description Representation
Return Value a table

ClientAPI.isModLoaded

Checks if the client has loaded the given mod ID
overload 1:
client.isModLoaded(modID)
Method Property Fluent Description Representation
modID accepts a String
Return Value a Boolean

ClientAPI.getFPS

Example by ChloeSpacedOut:
events.TICK:register(function()
log(client.getFPS())
end)
Gets the FPS of the client
Returns 0 if the fps counter isn't ready yet (or if your PC is just that bad)
overload 1:
client.getFPS()
Method Property Fluent Description Representation
Return Value an Integer

ClientAPI.isPaused

Example by ChloeSpacedOut:
events.TICK:register(function()
log(client.isPaused())
end)
Returns true if the client is paused
overload 1:
client.isPaused()
Method Property Fluent Description Representation
Return Value a Boolean

ClientAPI.getCameraPos

Example by ChloeSpacedOut:
Returns the position of the viewer's camera
overload 1:
client.getCameraPos()
Method Property Fluent Description Representation
Return Value a Vector3

ClientAPI.getCameraRot

Example by ChloeSpacedOut:
Returns the rotation of the viewer's camera
overload 1:
client.getCameraRot()
Method Property Fluent Description Representation
Return Value a Vector3

ClientAPI.getFOV

Example by ChloeSpacedOut:
Returns the current FOV option of the client, not including additional effects such as speed or sprinting
overload 1:
client.getFOV()
Method Property Fluent Description Representation
Return Value a Number

ClientAPI.getFPSString

Example by ChloeSpacedOut:
Gets the FPS string of the client, displayed in the F3 menu
Contains info on the fps,
the fps limit, vsync, cloud types, and biome blend radius
overload 1:
client.getFPSString()
Method Property Fluent Description Representation
Return Value a String

ClientAPI.getVersionName

Returns the extended name of the Minecraft version of your client
overload 1:
client.getVersionName()
Method Property Fluent Description Representation
Return Value a String

ClientAPI.isSnapshot

Returns if the client is running a snapshot or full release version
overload 1:
client.isSnapshot()
Method Property Fluent Description Representation
Return Value a Boolean

ClientAPI.getClientBrand

Returns the "version type" of your client, usually the client modloader brand
overload 1:
client.getClientBrand()
Method Property Fluent Description Representation
Return Value a String

ClientAPI.getServerBrand

Example by ChloeSpacedOut:
Returns the type of server you're on
In singleplayer,
this is "Integrated"
overload 1:
client.getServerBrand()
Method Property Fluent Description Representation
Return Value a String

ClientAPI.getParticleCount

Example by ChloeSpacedOut:
Returns the number of currently loaded particles
overload 1:
client.getParticleCount()
Method Property Fluent Description Representation
Return Value a String

ClientAPI.getWindowSize

Example by ChloeSpacedOut:
Returns the size of the Minecraft window in pixels, as {width, height}
overload 1:
client.getWindowSize()
Method Property Fluent Description Representation
Return Value a Vector2

ClientAPI.getUsedMemory

Example by ChloeSpacedOut:
Returns the number of bytes of memory Minecraft is currently using
overload 1:
client.getUsedMemory()
Method Property Fluent Description Representation
Return Value an Integer

ClientAPI.isHudEnabled

Example by ChloeSpacedOut:
Returns true if the hud is enabled (F1 disables the HUD)
overload 1:
client.isHudEnabled()
Method Property Fluent Description Representation
Return Value a Boolean

ClientAPI.getSoundStatistics

Returns a string containing information about the currently playing sounds on the client
This string appears in the F3 menu
overload 1:
client.getSoundStatistics()
Method Property Fluent Description Representation
Return Value a String

ClientAPI.getMaxMemory

Example by ChloeSpacedOut:
Returns the maximum amount of memory that Minecraft will try to use
overload 1:
client.getMaxMemory()
Method Property Fluent Description Representation
Return Value an Integer

ClientAPI.getAllocatedMemory

Returns the maximum amount of memory that Minecraft could possibly use
overload 1:
client.getAllocatedMemory()
Method Property Fluent Description Representation
Return Value an Integer

ClientAPI.getChunkStatistics

Returns a string containing information about the player's chunk
This string appears in the F3 menu
overload 1:
client.getChunkStatistics()
Method Property Fluent Description Representation
Return Value a String

ClientAPI.isWindowFocused

Example by ChloeSpacedOut:
Returns true if the Minecraft window is currently focused
overload 1:
client.isWindowFocused()
Method Property Fluent Description Representation
Return Value a Boolean

ClientAPI.getEntityCount

Example by ChloeSpacedOut:
Returns the number of currently loaded entities
overload 1:
client.getEntityCount()
Method Property Fluent Description Representation
Return Value an Integer

ClientAPI.getJavaVersion

Example by ChloeSpacedOut:
Returns your current Java version you're playing Minecraft with
overload 1:
client.getJavaVersion()
Method Property Fluent Description Representation
Return Value a String

ClientAPI.getSystemTime

Example by ChloeSpacedOut:
Returns the current system time in milliseconds
overload 1:
client.getSystemTime()
Method Property Fluent Description Representation
Return Value an Integer

ClientAPI.getMousePos

Example by ChloeSpacedOut:
Returns the position of the mouse in pixels, relative to the top-left corner
overload 1:
client.getMousePos()
Method Property Fluent Description Representation
Return Value a Vector2

ClientAPI.getCurrentEffect

Example by ChloeSpacedOut:
Returns the path to the currently applied shader, used when spectating an entity that has different vision than normal
Normally returns nil
overload 1:
client.getCurrentEffect()
Method Property Fluent Description Representation
Return Value either a String or nil

ClientAPI.getGuiScale

Example by ChloeSpacedOut:
Returns the current value of your Gui Scale setting
If you use auto,
then it gets the actual current scale
overload 1:
client.getGuiScale()
Method Property Fluent Description Representation
Return Value a Number

ClientAPI.hasIris

figura.docs.client.has_iris
overload 1:
client.hasIris()
Method Property Fluent Description Representation
Return Value a Boolean

ClientAPI.getTextDimensions

Returns the width and height of the given text, wrapping lines and trimming to a max width
overload 1:
client.getTextDimensions(text)
Method Property Fluent Description Representation
text accepts a String
Return Value a Vector2
overload 2:
client.getTextDimensions(text, maxWidth, wrap)
Method Property Fluent Description Representation
text accepts a String
maxWidth accepts an Integer
wrap accepts a Boolean
Return Value a Vector2

ClientAPI.getTextWidth

Example by ChloeSpacedOut:
Returns the width of the given text in pixels
In case of multiple lines,
return the largest width of all lines
overload 1:
client.getTextWidth(text)
Method Property Fluent Description Representation
text accepts a String
Return Value an Integer

ClientAPI.getCameraDir

Returns a unit vector pointing in the direction that the camera is facing
overload 1:
client.getCameraDir()
Method Property Fluent Description Representation
Return Value a Vector3

ClientAPI.hasIrisShader

figura.docs.client.has_iris_shader
overload 1:
client.hasIrisShader()
Method Property Fluent Description Representation
Return Value a Boolean

ClientAPI.hasResource

Checks if the specific resource exists within the client resources
overload 1:
client.hasResource(path)
Method Property Fluent Description Representation
path accepts a String
Return Value a Boolean

ClientAPI.getActiveLang

Example by ChloeSpacedOut:
Returns a string representation of the current game language
overload 1:
client.getActiveLang()
Method Property Fluent Description Representation
Return Value a String

ClientAPI.getTextHeight

Example by ChloeSpacedOut:
Returns the height of the given text in pixels
overload 1:
client.getTextHeight(text)
Method Property Fluent Description Representation
text accepts a String
Return Value an Integer

ClientAPI.uuidToIntArray

Converts a string UUID into its int array representation, returning a varargs of 4 ints
overload 1:
client.uuidToIntArray(uuid)
Method Property Fluent Description Representation
uuid accepts a String
Return Value a Varargs

ClientAPI.getFrameTime

Returns the current fraction between the last tick and the next tick
This is the value used as "delta" in the RENDER event
overload 1:
client.getFrameTime()
Method Property Fluent Description Representation
Return Value a Number

ClientAPI.compareVersions

Compares two versions if they are less than (-1), equals (0) or greater than (1)
overload 1:
client.compareVersions(version1, version2)
Method Property Fluent Description Representation
version1 accepts a String
version2 accepts a String
Return Value an Integer

ClientAPI.listAtlases

Returns a list of all registered atlases paths
overload 1:
client.listAtlases()
Method Property Fluent Description Representation
Return Value a table

ClientAPI.getCameraEntity

Returns the entity the camera is currently targeting, so returns the entity you are currently spectating, including yourself
overload 1:
client.getCameraEntity()
Method Property Fluent Description Representation
Return Value an EntityAPI

ClientAPI.intUUIDToString

Converts an int array UUID (as 4 separated arguments) into its hexadecimal string representation
overload 1:
client.intUUIDToString(a, b, c, d)
Method Property Fluent Description Representation
a accepts an Integer
b accepts an Integer
c accepts an Integer
d accepts an Integer
Return Value a String

ClientAPI.getViewer

Returns the player entity from the running client
overload 1:
client.getViewer()
Method Property Fluent Description Representation
Return Value a ViewerAPI

ClientAPI.getServerData

Returns a table with information on the currently connected server (also for singleplayer worlds)
overload 1:
client.getServerData()
Method Property Fluent Description Representation
Return Value a table

ClientAPI.getFiguraVersion

Gets the client Figura version
overload 1:
client.getFiguraVersion()
Method Property Fluent Description Representation
Return Value a String

ClientAPI.getTabList

Returns a table with the text shown in the tablist
overload 1:
client.getTabList()
Method Property Fluent Description Representation
Return Value a table

ClientAPI.getAtlas

Returns a TextureAtlasAPI object with information about the given atlas
Returns nil if the atlas was not found
overload 1:
client.getAtlas(path)
Method Property Fluent Description Representation
path accepts a String
Return Value a TextureAtlas

ClientAPI.getScaledWindowSize

Example by ChloeSpacedOut:
Returns the size of the window in Minecraft's internal GUI units
overload 1:
client.getScaledWindowSize()
Method Property Fluent Description Representation
Return Value a Vector2

ClientAPI.getTranslatedString

Returns the translated string of the given key
Translation is done using the current client language
Optionally takes a single argument,
or a list with all arguments, that will populate the translation
overload 1:
client.getTranslatedString(text)
Method Property Fluent Description Representation
text accepts a String
Return Value a String
overload 2:
client.getTranslatedString(text, args)
Method Property Fluent Description Representation
text accepts a String
args accepts anything
Return Value a String

ClientAPI.isDebugOverlayEnabled

Example by ChloeSpacedOut:
Returns true if the F3 screen is currently open
overload 1:
client.isDebugOverlayEnabled()
Method Property Fluent Description Representation
Return Value a Boolean

ClientAPI.getEntityStatistics

Returns a string containing information about the loaded entities on the client
This string appears in the F3 menu
overload 1:
client.getEntityStatistics()
Method Property Fluent Description Representation
Return Value a String

ClientAPI.getActiveResourcePacks

Returns a table with the active resource pack names
overload 1:
client.getActiveResourcePacks()
Method Property Fluent Description Representation
Return Value a table
a a