Buy Me a Coffee at ko-fi.com

Documentation for the various things Figura adds to the global lua state

A function that returns a table with all script file names from the specified path
If no path is specified, it will fetch from the root folder
A second argument, boolean, can be given to also list files inside subfolders
Folders can be accessed relative to the executing script using `./` and `../`

overload 1:
listFiles(): String[]
typings.1859653459
Method PropertyFluent DescriptionRepresentation
Return Value
overload 2:
listFiles(folder: String): String[]
typings.-1808118735typings.1859653459
Method PropertyFluent DescriptionRepresentation
folder accepts
Return Value
overload 3:
listFiles(folder: String, subFolders: Boolean): String[]
typings.-1808118735typings.1729365000typings.1859653459
Method PropertyFluent DescriptionRepresentation
folder accepts
subFolders accepts
Return Value

A function that writes its arguments to chat
Even though the syntax says only one argument, you can put as many as you want
All of them will print, and they'll be separated by a tab space
Returns the string representation of all values

overload 1:
log(...: AnyType): String
typings.821772070typings.-1808118735
Method PropertyFluent DescriptionRepresentation
... accepts
Return Value

Takes a Minecraft JSON string as an argument, and prints it to the chat formatted, without the lua print header
Even though the syntax says only one argument, you can put as many as you want
All of them will print, and they'll be appended in the end of the previous argument
Returns the formatted string

overload 1:
logJson(json: String): String
typings.-1808118735typings.-1808118735
Method PropertyFluent DescriptionRepresentation
json accepts
Return Value

The first argument is either a Table, or it's a Userdata, which refers to any of the added Figura types
Prints the table out to chat, specially formatted
If userdata is passed in, it is automatically converted to a table or string, and displayed
In the case of tables inside of tables, the "maxDepth" parameter will be used to determine how far to go
Default value for maxDepth is 1
Third argument, "silent", will skip the chat print and will only return the string

overload 1:
logTable(table: Table): String
typings.80563118typings.-1808118735
Method PropertyFluent DescriptionRepresentation
table accepts
Return Value
overload 2:
logTable(javaObject: Userdata): String
typings.-201367019typings.-1808118735
Method PropertyFluent DescriptionRepresentation
javaObject accepts
Return Value
overload 3:
logTable(table: Table, maxDepth: Integer): String
typings.80563118typings.-672261858typings.-1808118735
Method PropertyFluent DescriptionRepresentation
table accepts
maxDepth accepts
Return Value
overload 4:
logTable(javaObject: Userdata, maxDepth: Integer): String
typings.-201367019typings.-672261858typings.-1808118735
Method PropertyFluent DescriptionRepresentation
javaObject accepts
maxDepth accepts
Return Value
overload 5:
logTable(table: Table, maxDepth: Integer, silent: Boolean): String
typings.80563118typings.-672261858typings.1729365000typings.-1808118735
Method PropertyFluent DescriptionRepresentation
table accepts
maxDepth accepts
silent accepts
Return Value
overload 6:
logTable(javaObject: Userdata, maxDepth: Integer, silent: Boolean): String
typings.-201367019typings.-672261858typings.1729365000typings.-1808118735
Method PropertyFluent DescriptionRepresentation
javaObject accepts
maxDepth accepts
silent accepts
Return Value

Takes a JSON string as an argument, and converts it into a lua value.
Objects and arrays are converted to tables appropriately.

overload 1:
parseJson(jsonString: String): AnyType
typings.-1808118735typings.821772070
Method PropertyFluent DescriptionRepresentation
jsonString accepts
Return Value

A function that writes its arguments to chat
Even though the syntax says only one argument, you can put as many as you want
All of them will print, and they'll be separated by a tab space
Returns the string representation of all values

overload 1:
print(...: AnyType): String
typings.821772070typings.-1808118735
Method PropertyFluent DescriptionRepresentation
... accepts
Return Value

Takes a Minecraft JSON string as an argument, and prints it to the chat formatted, without the lua print header
Even though the syntax says only one argument, you can put as many as you want
All of them will print, and they'll be appended in the end of the previous argument
Returns the formatted string

overload 1:
printJson(json: String): String
typings.-1808118735typings.-1808118735
Method PropertyFluent DescriptionRepresentation
json accepts
Return Value

The first argument is either a Table, or it's a Userdata, which refers to any of the added Figura types
Prints the table out to chat, specially formatted
If userdata is passed in, it is automatically converted to a table or string, and displayed
In the case of tables inside of tables, the "maxDepth" parameter will be used to determine how far to go
Default value for maxDepth is 1
Third argument, "silent", will skip the chat print and will only return the string

overload 1:
printTable(table: Table): String
typings.80563118typings.-1808118735
Method PropertyFluent DescriptionRepresentation
table accepts
Return Value
overload 2:
printTable(javaObject: Userdata): String
typings.-201367019typings.-1808118735
Method PropertyFluent DescriptionRepresentation
javaObject accepts
Return Value
overload 3:
printTable(table: Table, maxDepth: Integer): String
typings.80563118typings.-672261858typings.-1808118735
Method PropertyFluent DescriptionRepresentation
table accepts
maxDepth accepts
Return Value
overload 4:
printTable(javaObject: Userdata, maxDepth: Integer): String
typings.-201367019typings.-672261858typings.-1808118735
Method PropertyFluent DescriptionRepresentation
javaObject accepts
maxDepth accepts
Return Value
overload 5:
printTable(table: Table, maxDepth: Integer, silent: Boolean): String
typings.80563118typings.-672261858typings.1729365000typings.-1808118735
Method PropertyFluent DescriptionRepresentation
table accepts
maxDepth accepts
silent accepts
Return Value
overload 6:
printTable(javaObject: Userdata, maxDepth: Integer, silent: Boolean): String
typings.-201367019typings.-672261858typings.1729365000typings.-1808118735
Method PropertyFluent DescriptionRepresentation
javaObject accepts
maxDepth accepts
silent accepts
Return Value

The require() function takes the name of one of your scripts, without the .lua extension
If this script has not been already run before, it will run that script and return the value that script returns
If it has been run before, then it will not run the file again, but it will return the same thing as the first time
If a required script has no returns, then require() will return true
If the name you give isn't any of your scripts, it will error
Scripts can be accessed relative to the executing script using `./` and `../`

overload 1:
require(scriptName: String): AnyType
typings.-1808118735typings.821772070
Method PropertyFluent DescriptionRepresentation
scriptName accepts
Return Value

Takes any lua value, and converts it into a json string.
Does not accept functions, they will be treated as null.

overload 1:
toJson(value: AnyType): String
typings.821772070typings.-1808118735
Method PropertyFluent DescriptionRepresentation
value accepts
Return Value

The global instance of the ActionWheelAPI and its subtypes

field signature:
action_wheel: ActionWheelAPI
typings.1118886197
Method PropertyFluent DescriptionRepresentation
Field Type

The global instance of the AnimationsAPI and its subtypes

field signature:
animations: AnimationAPI
typings.1338202134
Method PropertyFluent DescriptionRepresentation
Field Type

The global instance of AvatarAPI

field signature:
avatar: AvatarAPI
typings.1575301601
Method PropertyFluent DescriptionRepresentation
Field Type

The global instance of ClientAPI

field signature:
client: ClientAPI
typings.99848751
Method PropertyFluent DescriptionRepresentation
Field Type

The global instance of the ConfigAPI

field signature:
config: ConfigAPI
typings.1199487832
Method PropertyFluent DescriptionRepresentation
Field Type

The global instance of DataAPI

field signature:
data: DataAPI
typings.-1187148304
Method PropertyFluent DescriptionRepresentation
Field Type

The global instance of the EventsAPI and its subtypes

field signature:
events: EventsAPI
typings.2036267553
Method PropertyFluent DescriptionRepresentation
Field Type

A table containing all the metatables for Figura's object types
The metatables are editable

field signature:
figuraMetatables: Table
typings.80563118
Method PropertyFluent DescriptionRepresentation
Field Type

The global instance of FileAPI

field signature:
file: FileAPI
typings.809623262
Method PropertyFluent DescriptionRepresentation
Field Type

The global instance of HostAPI

field signature:
host: HostAPI
typings.-1531650254
Method PropertyFluent DescriptionRepresentation
Field Type

The global instance of JsonAPI

field signature:
json: JsonAPI
typings.354000882
Method PropertyFluent DescriptionRepresentation
Field Type

The global instance of the KeybindAPI and its subtypes

field signature:
keybinds: KeybindAPI
typings.595474814
Method PropertyFluent DescriptionRepresentation
Field Type

The global instance of the MatricesAPI and its subtypes

field signature:
matrices: MatricesAPI
typings.721978944
Method PropertyFluent DescriptionRepresentation
Field Type

The global instance of the Avatar Models and its subtypes

field signature:
models: ModelPart
typings.-6801764
Method PropertyFluent DescriptionRepresentation
Field Type

The global instance of the NameplateAPI and its subtypes

field signature:
nameplate: NameplateAPI
typings.-1261873457
Method PropertyFluent DescriptionRepresentation
Field Type

The global instance of NetworkingAPI

field signature:
net: NetworkingAPI
typings.475951718
Method PropertyFluent DescriptionRepresentation
Field Type

The global instance of ParticleAPI

field signature:
particles: ParticleAPI
typings.-1857265260
Method PropertyFluent DescriptionRepresentation
Field Type

The global instance of PingAPI

field signature:
pings: PingAPI
typings.1096632104
Method PropertyFluent DescriptionRepresentation
Field Type

The global instance of the EntityAPI and its subtypes

field signature:
player: PlayerAPI
typings.131894105
Method PropertyFluent DescriptionRepresentation
Field Type

The global instance of RaycastAPI

field signature:
raycast: RaycastAPI
typings.-1476671727
Method PropertyFluent DescriptionRepresentation
Field Type

The global instance of RendererAPI

field signature:
renderer: RendererAPI
typings.45746743
Method PropertyFluent DescriptionRepresentation
Field Type

The global instance of ResourcesAPI

field signature:
resources: ResourcesAPI
typings.-219175467
Method PropertyFluent DescriptionRepresentation
Field Type

The global instance of SoundAPI

field signature:
sounds: SoundAPI
typings.1807272619
Method PropertyFluent DescriptionRepresentation
Field Type

The global instance of the TextureAPI

field signature:
textures: TextureAPI
typings.521480991
Method PropertyFluent DescriptionRepresentation
Field Type

Figura overrides lua's type() function
When used on Figura types, returns the type's name as seen in the docs and in the figuraMetatables global
When called on a table that has a metatable with a __type key, returns the corresponding value

field signature:
type: (AnyType) -> String
typings.-1103753845
Method PropertyFluent DescriptionRepresentation
Field Type

An alias for player, just in case the user of your avatar isn't a player
(Foreshadowing?)

field signature:
user: EntityAPI
typings.1263373079
Method PropertyFluent DescriptionRepresentation
Field Type

The global instance of the VanillaModelAPI and its subtypes

field signature:
vanilla_model: VanillaModelAPI
typings.1430393516
Method PropertyFluent DescriptionRepresentation
Field Type

An alias for "vectors.vec"

field signature:
vec: (Number, Number, Number | nil, Number | nil, Number | nil, Number | nil) -> AnyType where (Number, Number) -> Vector2 and (Number, Number, Number) -> Vector3 and (Number, Number, Number, Number) -> Vector4 and (Number, Number, Number, Number, Number) -> Vector5 and (Number, Number, Number, Number, Number, Number) -> Vector6
typings.-44348180
Method PropertyFluent DescriptionRepresentation
Field Type

The global instance of the VectorsAPI and its subtypes

field signature:
vectors: VectorsAPI
typings.2012784778
Method PropertyFluent DescriptionRepresentation
Field Type

The global instance of the WorldAPI and its subtypes

field signature:
world: WorldAPI
typings.100844872
Method PropertyFluent DescriptionRepresentation
Field Type