Client
The global instance of ClientAPI
getViewer()
Returns the player entity from the running client
Example:
client:getViewer()
Versions
getVersion()
Returns the Minecraft version of your client
Example:
client:getVerison()
getVersionName()
Returns the extended name of the Minecraft version of your client
Example:
client:getVersionName()
getJavaVersion()
Returns your current Java version you're playing Minecraft with
Example:
client:getJavaVersion()
isSnapshot()
Returns if the client is running a snapshot or full release version
Example:
client:isSnapshot()
getFiguraVersion()
Gets the client Figura version
Example:
client:getFiguraVersion()
compareVersions()
Compares two versions if they are less than (-1), equals (0) or greater than (1)
Example:
client:compareVersions("0.1.0", "0.1.3")
isModLoaded(string)
Checks if the client have loaded the given mod ID
Example:
client:isModLoaded("origins")
hasIris()
Checks if the client has the Iris mod installed
Example:
client:hasIris()
hasIrisShader()
Checks if the client is currently using an Iris shader
Example:
client:hasIrisShader()
getClientBrand()
Returns the "version type" of your client, usually the client modloader brand
Example:
client:getClientBrand()
getServerBrand()
Returns the type of server you're on
In singleplayer, this is "Integrated"
Example:
client:getServerBrand()
Client Camera
getCameraPos()
Returns the position of the viewer's camera
Example:
client:getCameraPos()
getCameraRot()
Returns the rotation of the viewer's camera
Example:
client:getCameraRot()
getFOV()
Returns the current FOV option of the client, not including additional effects such as speed or sprinting
Example:
client:getFOV()
getWindowSize()
Returns the size of the Minecraft window in pixels, as {width, height}
Example:
client:getWindowSize()
getScaledWindowSize()
Returns the size of the window in Minecraft's interal GUI units
Example:
client:getScaledWindowSize()
getGuiScale()
Returns the current value of your Gui Scale setting
If you use auto, then it gets the actual current scale
Example:
client:getGuiScale()
getMousePos()
Returns the position of the mouse in pixels, relative to the top-left corner
Example:
client:getMousePos()
getCameraDir()
Returns a unit vector pointing in the direction that the camera is facing
Example:
client:getCameraDir()
getCameraEntity()
Returns the entity the camera is currently targeting, so returns the entity you are currently spectating, including yourself
Example:
client:getCameraEntity()
Client State
isPaused()
Returns true if the client is paused
Example:
client:isPaused()
isHudEnabled()
Returns true if the hud is enabled (F1 disables the HUD)
Example:
client:isHudEnabled()
isDebugOverlayEnabled()
Returns true if the F3 screen is currently open
Example:
client:isDebugOverlayEnabled()
getActiveResourcePacks()
Returns a table with the active resource pack names
Example:
client:getActiveResourcePacks()
hasResource()
Checks if the specific resource exists withing the client resources
Example:
client:hasResource()
getActiveLang()
Returns a string representation of the current game language
Example:
client:getActiveLang()
isWindowFocused()
Returns true if the Minecraft window is currently focused
Example:
client:isWindowFocused()
getCurrentEffect()
Returns the path to the currently applied shader, used when spectating an entity that has different vision than normal
Normally returns nil
Example:
client:getCurrentEffect()
Stats
getEntityStatistics()
Returns a string containing information about the loaded entities on the client
This string appears in the F3 menu
Example:
client:getEntityStatistics()
getServerData()
Returns a table with information of the current connected server (also for singleplayer worlds)
Example:
client:getServerData()
getDate()
Returns a table with information about the client current time
Example:
client:getDate()
getSystemTime()
Returns the current system time in milliseconds
Example:
client:getSystemTime()
getFPS()
Gets the FPS of the client
Returns 0 if the fps counter isn't ready yet (or if your pc is just that bad)
Example:
client:getFPS()
getFPSString()
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
Example:
client:getFPSString()
getFrameTime()
Returns the current fraction between the last tick and the next tick
This is the value used as "delta" in the RENDER event
Example:
client:getFrameTime()
getSoundStatistics()
Returns a string containing information about the currently playing sounds on the client
This string appears in the F3 menu
Example:
client:getSoundStatistics()
getMaxMemory()
Returns the maximum amount of memory that Minecraft will try to use
Example:
client:getMaxMemory()
getAllocatedMemory()
Returns the maximum amount of memory that Minecraft can possibly use
Example:
client:getAllocatedMemory()
getChunkStatistics()
Returns a string containing information about the player's chunk
This string appears in the F3 menu
Example:
client:getChunkStatistics()
getParticleCount()
Returns the number of currently loaded particles
Example:
client:getParticleCount()
getUsedMemory()
Returns the number of bytes of memory Minecraft is currently using
Example:
client:getUsedMemory()
getEntityCount()
Returns the number of currently loaded entities
Example:
client:getEntityCount()
Misc
getTranslatedString(string,any)
Returns the translated string of the given key
Translation is done using the current client language
Optionally take a single argument, or a list with all arguments, that will populate the translation
Example:
client.getTranslatedString("figura.gui.wardrobe.drop_files")
listAtlases()
Returns a list of all registered atlases paths
Example:
client:listAtlases()
getAtlas(string)
Returns a TextureAtlasAPI object with information about the given atlas
Returns nil if the atlas was not found
Example:
client:getAtlas()
intUUIDToString(int,int,int,int)
Converts an int array UUID (as 4 separated arguments) into its hexadecimal string representation
Example:
client:intUUIDToString()
uuidToIntArray(string)
Converts a string UUID into its int array representation, returning a varargs of 4 ints
Example:
client:uuidToIntArray("5003b2ce-7a8d-4c56-8b91-ec705985fe08")
getTextDimensions(string,int,bool)
Returns the width and height of the given text, wrapping lines and trimming to a max width
Example:
client:getTextDimensions("Example text", 40, true)
getTextWidth(string)
Returns the width and height of the given text, wrapping lines and trimming to a max width
Example:
client:getTextWidth("Example text")
getTextHeight(string)
Returns the height of the given text in pixels
Example:
client:getTextHeight("Example text")
getTabList()
Returns a table with the text shown in the tablist
Example:
client:getTabList()