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.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.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.getAir

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

HostAPI.getReachDistance

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

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.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.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.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.clearTitle

Clears the current title from the GUI
overload 1:
host:clearTitle()
Method Property Fluent Description Representation
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.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.setChatMessage

Modifies a chat message with the given text
Takes an index,
were 1 means the last message on chat
Setting the message to nil will effectively remove it from the chat
overload 1:
host:setChatMessage(index)
Method Property Fluent Description Representation
index accepts an Integer
Return Value a HostAPI
overload 2:
host:setChatMessage(index, newMessage)
Method Property Fluent Description Representation
index accepts an Integer
newMessage accepts a String
Return Value a HostAPI
overload 3:
host:setChatMessage(index, newMessage, backgroundColor)
Method Property Fluent Description Representation
index accepts an Integer
newMessage accepts a String
backgroundColor accepts a Vector3
Return Value a HostAPI

HostAPI.getChatMessage

Returns a table with information about a chat message
Takes an index,
where 1 means the last message on chat
overload 1:
host:getChatMessage(index)
Method Property Fluent Description Representation
index accepts an Integer
Return Value a table

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.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.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.isContainerOpen

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

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.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.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.getScreenSlotCount

Gets the number of slots in the screen the player is currently in
If the player is not currently in a screen or the screen has no slots,
returns nil
overload 1:
host:getScreenSlotCount()
Method Property Fluent Description Representation
Return Value an Integer

HostAPI.getScreenSlot

Gets the item in a screen slot
The slot is either their numerical id (0 indexed) or the slot string,
as used in the /item command
If the player is not currently in a screen,
the screen has no slots, or the slot index is greater than the maximum, returns nil
overload 1:
host:getScreenSlot(slot)
Method Property Fluent Description Representation
slot accepts a String
Return Value an ItemStack
overload 2:
host:getScreenSlot(slot)
Method Property Fluent Description Representation
slot accepts an Integer
Return Value an ItemStack

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.setSlot

Sets a slot with an ItemStack
The slot is either their numerical id (0 indexed) or the slot string,
as used in the /item command
Slot -1 uses the first available slot
Only runs for creative mode
overload 1:
host:setSlot(slot)
Method Property Fluent Description Representation
slot accepts a String
Return Value a HostAPI
overload 2:
host:setSlot(slot)
Method Property Fluent Description Representation
slot accepts an Integer
Return Value a HostAPI
overload 3:
host:setSlot(slot, item)
Method Property Fluent Description Representation
slot accepts a String
item accepts a String
Return Value a HostAPI
overload 4:
host:setSlot(slot, item)
Method Property Fluent Description Representation
slot accepts an Integer
item accepts an ItemStack
Return Value a HostAPI

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.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.getPickEntity

Returns the currently targeted entity set by the client
overload 1:
host:getPickEntity()
Method Property Fluent Description Representation
Return Value an EntityAPI

HostAPI.warnToLog

Write a warning directly to the minecraft log,
allowing for logging debug data without filling chat
overload 1:
host:warnToLog(string)
Method Property Fluent Description Representation
string accepts a String
Return Value nil

HostAPI.getClipboard

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

HostAPI.writeToLog

Write directly to the minecraft log, allowing for
logging debug data without filling chat
overload 1:
host:writeToLog(string)
Method Property Fluent Description Representation
string accepts a String
Return Value nil

HostAPI.isAvatarUploaded

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

HostAPI.isChatVerified

figura.docs.host.is_chat_verified
overload 1:
host:isChatVerified()
Method Property Fluent Description Representation
Return Value a Boolean

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.getPickBlock

Returns the current targeted block set by the client
Returns the block,
the hit position, and the targeted block face as three separate values
overload 1:
host:getPickBlock()
Method Property Fluent Description Representation
Return Value a Varargs

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.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.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.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.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.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.clipboard

Sets the clipboard text
overload 1:
host:clipboard(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