host

The global instance of HostAPI
field signature:
host
Method Property Fluent Description Representation
Field Type a HostAPI

HostAPI.getSlot

Gets an ItemStack for the item in the given slot
The slot is either their numerical id (0 indexed) or the slot string,
as used in the /item command
overload 1:
host:getSlot(slot)
Method Property Fluent Description Representation
slot accepts a String
Return Value an ItemStack
overload 2:
host:getSlot(slot)
Method Property Fluent Description Representation
slot accepts an Integer
Return Value an ItemStack

HostAPI.setTitle

Sets the current title to the given text
The text is given as json
overload 1:
host:setTitle(text)
Method Property Fluent Description Representation
text accepts a String
Return Value a HostAPI

HostAPI.saveTexture

figura.docs.host.save_texture
overload 1:
host:saveTexture(texture)
Method Property Fluent Description Representation
texture accepts a Texture
Return Value a HostAPI

HostAPI.getClipboard

Gets the text from the clipboard
overload 1:
host:getClipboard()
Method Property Fluent Description Representation
Return Value a String

HostAPI.setClipboard

Sets the clipboard text
overload 1:
host:setClipboard(text)
Method Property Fluent Description Representation
text accepts a String
Return Value a HostAPI

HostAPI.isAvatarUploaded

Checks if this avatar is currently uploaded
overload 1:
host:isAvatarUploaded()
Method Property Fluent Description Representation
Return Value a Boolean

HostAPI.isHost

Returns true if this instance of the script is running on host
overload 1:
host:isHost()
Method Property Fluent Description Representation
Return Value a Boolean

HostAPI.setUnlockCursor

Toggles locking of your cursor, letting you move it freely on the screen instead of it controlling your player's rotation
overload 1:
host:setUnlockCursor(boolean)
Method Property Fluent Description Representation
boolean accepts a Boolean
Return Value a HostAPI

HostAPI.setTitleTimes

Sets the duration of the title on the screen, also its fade-in and fade-out durations
overload 1:
host:setTitleTimes(timesData)
Method Property Fluent Description Representation
timesData accepts a Vector3
Return Value a HostAPI
overload 2:
host:setTitleTimes(fadeInTime, stayTime, fadeOutTime)
Method Property Fluent Description Representation
fadeInTime accepts an Integer
stayTime accepts an Integer
fadeOutTime accepts an Integer
Return Value a HostAPI

HostAPI.isCursorUnlocked

Checks if the cursor is currently unlocked
Only responds to your own changes in your script,
not anything done by Minecraft itself
overload 1:
host:isCursorUnlocked()
Method Property Fluent Description Representation
Return Value a Boolean

HostAPI.clearTitle

Clears the current title from the GUI
overload 1:
host:clearTitle()
Method Property Fluent Description Representation
Return Value a HostAPI

HostAPI.swingArm

Animates swinging the player's arm
If the boolean is true,
then the offhand is the one that swings
overload 1:
host:swingArm()
Method Property Fluent Description Representation
Return Value a HostAPI
overload 2:
host:swingArm(offhand)
Method Property Fluent Description Representation
offhand accepts a Boolean
Return Value a HostAPI

HostAPI.sendChatCommand

Sends the given command in the chat
overload 1:
host:sendChatCommand(command)
Method Property Fluent Description Representation
command accepts a String
Return Value a HostAPI

HostAPI.setActionbar

Sets the action bar message to the given text
The boolean parameter defaults to false
overload 1:
host:setActionbar(text)
Method Property Fluent Description Representation
text accepts a String
Return Value a HostAPI
overload 2:
host:setActionbar(text, animated)
Method Property Fluent Description Representation
text accepts a String
animated accepts a Boolean
Return Value a HostAPI

HostAPI.setChatColor

Sets the color of the text that is currently being typed into the chat window
overload 1:
host:setChatColor(color)
Method Property Fluent Description Representation
color accepts a Vector3
Return Value a HostAPI
overload 2:
host:setChatColor(r, g, b)
Method Property Fluent Description Representation
r accepts a Number
g accepts a Number
b accepts a Number
Return Value a HostAPI

HostAPI.getChatText

Gets the text that is currently being typed into the chat window
overload 1:
host:getChatText()
Method Property Fluent Description Representation
Return Value a String

HostAPI.getChatColor

Gets the chat window text color
overload 1:
host:getChatColor()
Method Property Fluent Description Representation
Return Value an Integer

HostAPI.setChatText

Sets the text currently being typed in the chat window to the given string
overload 1:
host:setChatText(text)
Method Property Fluent Description Representation
text accepts a String
Return Value a HostAPI

HostAPI.setSubtitle

Sets the current subtitle to the given text
The text is given as a JSON string
overload 1:
host:setSubtitle(text)
Method Property Fluent Description Representation
text accepts a String
Return Value a HostAPI

HostAPI.appendChatHistory

Appends the message on the recent chat history
overload 1:
host:appendChatHistory(message)
Method Property Fluent Description Representation
message accepts a String
Return Value a HostAPI

HostAPI.getScreen

Gets the class name of the screen the player is currently on
If the player is not currently in a screen,
returns nil
overload 1:
host:getScreen()
Method Property Fluent Description Representation
Return Value either a String or nil

HostAPI.isChatOpen

Checks if the host has the chat screen opened
overload 1:
host:isChatOpen()
Method Property Fluent Description Representation
Return Value a Boolean

HostAPI.isContainerOpen

Checks if the host has a container screen opened
overload 1:
host:isContainerOpen()
Method Property Fluent Description Representation
Return Value a Boolean

HostAPI.isJumping

Checks if the player is jumping
Note this is only true during the first tick the player started jumping
overload 1:
host:isJumping()
Method Property Fluent Description Representation
Return Value a Boolean

HostAPI.sendChatMessage

Sends the given message in the chat
overload 1:
host:sendChatMessage(message)
Method Property Fluent Description Representation
message accepts a String
Return Value a HostAPI

HostAPI.screenshot

Takes a screenshot from the current screen and returns a Texture of it
overload 1:
host:screenshot(name)
Method Property Fluent Description Representation
name accepts a String
Return Value a Texture

HostAPI.getReachDistance

Returns the current reach distance of the player
overload 1:
host:getReachDistance()
Method Property Fluent Description Representation
Return Value a Number

HostAPI.getAir

Gets the remaining amount of air of the player
overload 1:
host:getAir()
Method Property Fluent Description Representation
Return Value an Integer

HostAPI.getStatusEffects

Returns a table of all of the player's status effects
The table contains sub-tables,
each of which contains the name, amplifier, duration, and particle visibility of each status effect
overload 1:
host:getStatusEffects()
Method Property Fluent Description Representation
Return Value a table

HostAPI.getAttackCharge

Returns a fraction (0 to 1) of the charge of the player attack
If less than 1,
every attack will result in a weak attack
overload 1:
host:getAttackCharge()
Method Property Fluent Description Representation
Return Value a Number

HostAPI.isFlying

Checks if the player is currently flying
overload 1:
host:isFlying()
Method Property Fluent Description Representation
Return Value a Boolean

HostAPI.title

Sets the current title to the given text
The text is given as json
overload 1:
host:title(text)
Method Property Fluent Description Representation
text accepts a String
Return Value a HostAPI

HostAPI.clipboard

Sets the clipboard text
overload 1:
host:clipboard(text)
Method Property Fluent Description Representation
text accepts a String
Return Value a HostAPI

HostAPI.titleTimes

Sets the duration of the title on the screen, also its fade-in and fade-out durations
overload 1:
host:titleTimes(timesData)
Method Property Fluent Description Representation
timesData accepts a Vector3
Return Value a HostAPI
overload 2:
host:titleTimes(fadeInTime, stayTime, fadeOutTime)
Method Property Fluent Description Representation
fadeInTime accepts an Integer
stayTime accepts an Integer
fadeOutTime accepts an Integer
Return Value a HostAPI

HostAPI.actionbar

Sets the action bar message to the given text
The boolean parameter defaults to false
overload 1:
host:actionbar(text)
Method Property Fluent Description Representation
text accepts a String
Return Value a HostAPI
overload 2:
host:actionbar(text, animated)
Method Property Fluent Description Representation
text accepts a String
animated accepts a Boolean
Return Value a HostAPI

HostAPI.chatColor

Sets the color of the text that is currently being typed into the chat window
overload 1:
host:chatColor(color)
Method Property Fluent Description Representation
color accepts a Vector3
Return Value a HostAPI
overload 2:
host:chatColor(r, g, b)
Method Property Fluent Description Representation
r accepts a Number
g accepts a Number
b accepts a Number
Return Value a HostAPI

HostAPI.chatText

Sets the text currently being typed in the chat window to the given string
overload 1:
host:chatText(text)
Method Property Fluent Description Representation
text accepts a String
Return Value a HostAPI

HostAPI.subtitle

Sets the current subtitle to the given text
The text is given as a JSON string
overload 1:
host:subtitle(text)
Method Property Fluent Description Representation
text accepts a String
Return Value a HostAPI

HostAPI.unlockCursor

Setting this value to true will unlock your cursor, letting you move it freely on the screen instead of it controlling your player's rotation
field signature:
unlockCursor
Method Property Fluent Description Representation
Field Type a Boolean
a a