Renderer
A global API providing functions that change the way Minecraft renders your player
This page is a WIP. It contains all the information in Figura's documentation but we're working on adding more helpful descriptions.
Altering the Camera
setCameraMatrix()
Aliases: cameraMatrix()
Sets the camera matrix with the given matrix
setCameraMatrix(matrix)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
matrix | Matrix4 | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
Example:
-- I hope you don't get dizzy
local t = 1
function events.tick()
t = t + 1
end
function events.render(delta)
local theta = 2 * math.pi * ((t + delta) / 20)
local rotMat = matrices.mat4():rotateY(math.deg(theta))
renderer:setCameraMatrix(rotMat)
end
getCameraMatrix()
Returns the modified camera matrix
getCameraMatrix()
Returns:
Type | Description |
---|---|
Matrix4 | - |
Example:
renderer:getCameraMatrix()
setCameraNormal()
Aliases: cameraNormal()
Sets the camera normal matrix with the given matrix
setCameraNormal(matrix)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
matrix | Matrix3 | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
Example:
local t = 0
local flipped = false
function events.tick()
if t % 20 == 0 then
flipped = not flipped
end
local rotMat = matrices.mat3():rotateY(flipped and 180 or 0)
renderer:setCameraNormal(rotMat)
t = t + 1
end
getCameraNormal()
Returns the modified camera normal matrix
getCameraNormal()
Returns:
Type | Description |
---|---|
Matrix3 | - |
Example:
renderer:getCameraNormal()
getCameraOffsetPivot()
Gets the offset pivot for the camera
getCameraOffsetPivot()
Returns:
Type | Description |
---|---|
Vector3 | - |
Example:
renderer:getCameraOffsetPivot()
getCameraOffsetRot()
Gets the offset rotation for the camera
getCameraOffsetRot()
Returns:
Type | Description |
---|---|
Vector3 | - |
Example:
renderer:getCameraOffsetRot()
setCameraPivot()
Aliases: cameraPivot()
Sets the absolute pivot for the camera
The pivot will also move the camera
Its values are relative to the World
Nil values for pivot are assumed to be 0
For relative rotation values, check out the "offset" pivot function
- Overload 1
- Overload 2
setCameraPivot(pivot)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pivot | Vector3 | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
setCameraPivot(x, y, z)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x | Number | - | - |
y | Number | - | - |
z | Number | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
Example:
-- I wonder what's going on at spawn
renderer:setCameraPivot(0, 100, 0)
getCameraPivot()
Gets the absolute pivot for the camera
getCameraPivot()
Returns:
Type | Description |
---|---|
Vector3 | - |
Example:
renderer:getCameraPivot()
setCameraPos()
Aliases: cameraPos()
Sets the position offset for the camera
Nil values for position are assumed to be 0
- Overload 1
- Overload 2
setCameraPos(pos)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pos | Vector3 | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
setCameraPos(x, y, z)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x | Number | - | - |
y | Number | - | - |
z | Number | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
Example:
renderer:setCameraPos(0, 2, 0)
getCameraPos()
Gets the position offset for the camera
getCameraPos()
Returns:
Type | Description |
---|---|
Vector3 | - |
Example:
renderer:getCameraPos()
setCameraRot()
Aliases: cameraRot()
Sets the absolute rotation of the camera
The position is not taken into account for roll
Nil values for rotation are assumed to be 0
For relative rotation values, check out the "offset" rot function
- Overload 1
- Overload 2
setCameraRot(rot)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rot | Vector3 | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
setCameraRot(x, y, z)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x | Number | - | - |
y | Number | - | - |
z | Number | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
Example:
renderer:setCameraRot(0, 90, 0)
getCameraRot()
Gets the absolute rotation of the camera
getCameraRot()
Returns:
Type | Description |
---|---|
Vector3 | - |
Example:
renderer:getCameraRot()
setOffsetCameraPivot()
Aliases: offsetCameraPivot()
Sets the offset pivot for the camera
The pivot will also move the camera
Its values are relative to the world
Nil values for pivot are assumed to be 0
For relative rotation values, check out the non-offset pivot function
- Overload 1
- Overload 2
setOffsetCameraPivot(pivot)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pivot | Vector3 | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
setOffsetCameraPivot(x, y, z)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x | Number | - | - |
y | Number | - | - |
z | Number | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
Example:
renderer:setOffsetCameraPivot(0, 2, 0)
setOffsetCameraRot()
Aliases: offsetCameraRot()
Sets the offset rotation for the camera
Nil values for rotation are assumed to be 0
Angles are given in degrees
For absolute rotation values, check out the non-offset rot function
- Overload 1
- Overload 2
setOffsetCameraRot(rot)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rot | Vector3 | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
setOffsetCameraRot(x, y, z)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x | Number | - | - |
y | Number | - | - |
z | Number | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
Example:
renderer:setOffsetCameraRot(0, 90, 0)
Detecting Camera Information
isFirstPerson()
Checks if your camera is in the first person view
isFirstPerson()
Returns:
Type | Description |
---|---|
Boolean | - |
Example:
renderer:isFirstPerson()
isCameraBackwards()
Checks if your camera is in the backward third person view
isCameraBackwards()
Returns:
Type | Description |
---|---|
Boolean | - |
Example:
renderer:isCameraBackwards()
Element Rendering
setBlockOutlineColor()
Aliases: blockOutlineColor()
Sets the color of the selected block outline
Default alpha is 0.4
Might not be compatible with shaders
- Overload 1
- Overload 2
- Overload 3
setBlockOutlineColor(rgb)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rgb | Vector3 | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
setBlockOutlineColor(rgba)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rgba | Vector4 | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
setBlockOutlineColor(r, g, b, a)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
r | Number | - | - |
g | Number | - | - |
b | Number | - | - |
a | Number | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
Example:
renderer:setBlockOutlineColor(0, 0, 1, 0.4)
getBlockOutlineColor()
Returns the set color for the selected block outline
Default nil
getBlockOutlineColor()
Returns:
Type | Description |
---|---|
Vector4 | - |
Example:
renderer:getBlockOutlineColor()
setCrosshairOffset()
Aliases: crosshairOffset()
Sets the offset of your crosshair
- Overload 1
- Overload 2
setCrosshairOffset(vec)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vec | Vector2 | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
setCrosshairOffset(x, y)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x | Integer | - | - |
y | Integer | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
Example:
renderer:setCrosshairOffset(20, 20)
getCrosshairOffset()
Gets the offset of your crosshair
getCrosshairOffset()
Returns:
Type | Description |
---|---|
Vector2 | - |
Example:
renderer:getCrosshairOffset()
setEyeOffset()
Aliases: eyeOffset()
This function can be caught by anti-cheats and could get you banned from servers
Sets an offset for the entity eye position, altering the targeted block and entity
- Overload 1
- Overload 2
setEyeOffset(pos)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pos | Vector3 | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
setEyeOffset(x, y, z)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x | Number | - | - |
y | Number | - | - |
z | Number | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
Example:
renderer:setEyeOffset(0, 2, 0)
getEyeOffset()
Returns the offset for the entity eye position
Default nil
getEyeOffset()
Returns:
Type | Description |
---|---|
Vector3 | - |
Example:
renderer:getEyeOffset()
setFOV()
Aliases: fov()
Sets the multiplier of your fov
The default value is nil, which means no changes will be applied to your fov
- Overload 1
- Overload 2
setFOV(fov)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fov | Number | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
Example:
renderer:setFOV(2)
getFOV()
Gets the multiplier of your fov
getFOV()
Returns:
Type | Description |
---|---|
Number | - |
Example:
renderer:getFOV()
setForcePaperdoll()
Sets if the paperdoll should forcefully be rendered
setForcePaperdoll(forcePaperdoll)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
forcePaperdoll | Boolean | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
Example:
renderer:setForcePaperdoll(true)
setOutlineColor()
Aliases: outlineColor()
Sets the custom glowing effect's outline color
- Overload 1
- Overload 2
setOutlineColor(rgb)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rgb | Vector3 | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
setOutlineColor(r, g, b)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
r | Number | - | - |
g | Number | - | - |
b | Number | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
Example:
renderer:setOutlineColor(0, 0, 1)
getOutlineColor()
Gets the custom glowing effect's outline color
getOutlineColor()
Returns:
Type | Description |
---|---|
Vector3 | - |
Example:
renderer:getOutlineColor()
setPostEffect()
Aliases: postEffect()
Sets the current rendering effect
Same as the discontinued Super Secret Settings
setPostEffect(effect)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
effect | String | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
Example:
renderer:setPostEffect("invert")
setPrimaryFireTexture()
Aliases: primaryFireTexture()
Sets a custom primary fire texture, to render while the entity is on fire
The effect is compound by two layers
The secondary layer is what renders in first person
The absence of a secondary layer uses the primary layer as fallback
setPrimaryFireTexture(id)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id | String | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
Example:
renderer:setPrimaryFireTexture("textures/block/soul_fire_0")
getPrimaryFireTexture()
Gets the current custom primary fire texture
getPrimaryFireTexture()
Returns:
Type | Description |
---|---|
String | - |
Example:
renderer:getPrimaryFireTexture()
setRenderCrosshair()
Sets if your crosshair should be rendered
setRenderCrosshair(renderCrosshair)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
renderCrosshair | Boolean | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
Example:
renderer:setRenderCrosshair(false)
setRenderFire()
Sets if the fire effect should be rendered
setRenderFire(renderFire)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
renderFire | Boolean | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
Example:
renderer:setRenderFire(false)
setRenderHUD()
Sets if the vanilla HUD should be rendered
setRenderHUD(renderHUD)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
renderHUD | Boolean | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
Example:
renderer:setRenderHUD(false)
setRenderLeftArm()
Aliases: renderLeftArm()
Toggle if the left arm should be rendered in first person, regardless if you are holding an item or not
setRenderLeftArm(bool)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bool | Boolean | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
Example:
renderer:setRenderLeftArm(true)
getRenderLeftArm()
Gets if the left arm should be rendered while in first person
getRenderLeftArm()
Returns:
Type | Description |
---|---|
Boolean | - |
Example:
renderer:getRenderLeftArm()
setRenderRightArm()
Aliases: renderRightArm()
Toggle if the right arm should be rendered in first person, regardless if you are holding an item or not
setRenderRightArm(bool)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bool | Boolean | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
Example:
renderer:setRenderRightArm(true)
getRenderRightArm()
Gets if the right arm should be rendered while in first person
getRenderRightArm()
Returns:
Type | Description |
---|---|
Boolean | - |
Example:
renderer:getRenderRightArm()
setRenderVehicle()
Sets if your vehicle should be rendered
setRenderVehicle(renderVehicle)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
renderVehicle | Boolean | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
Example:
renderer:setRenderVehicle(false)
setRootRotationAllowed()
Aliases: rootRotationAllowed()
Sets if the model should have root rotations applied to it or not
Default true
setRootRotationAllowed(bool)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bool | Boolean | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
Example:
renderer:setRootRotationAllowed(true)
getRootRotationAllowed()
Gets if the model should have root rotations applied
getRootRotationAllowed()
Returns:
Type | Description |
---|---|
Boolean | - |
Example:
renderer:getRootRotationAllowed()
setSecondaryFireTexture()
Aliases: secondaryFireTexture()
Sets a custom secondary fire texture, to render while the entity is on fire
The effect is compound by two layers
The secondary layer is what renders in first person
The absence of a secondary layer uses the primary layer as fallback
setSecondaryFireTexture(id)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id | String | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
Example:
renderer:setSecondaryFireTexture("textures/block/soul_fire_1")
getSecondaryFireTexture()
Gets the current custom secondary fire texture
getSecondaryFireTexture()
Returns:
Type | Description |
---|---|
String | - |
Example:
renderer:getSecondaryFireTexture()
setShadowRadius()
Aliases: shadowRadius()
Sets the radius of your shadow
The default value is nil, which means to use the vanilla default of 0.5 for players
The maximum value is 12
- Overload 1
- Overload 2
setShadowRadius(radius)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
radius | Number | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
Example:
renderer:setShadowRadius(12)
getShadowRadius()
Gets the radius of your shadow
getShadowRadius()
Returns:
Type | Description |
---|---|
Number | - |
Example:
renderer:getShadowRadius()
setUpsideDown()
Aliases: upsideDown()
Sets if this entity will be rendered upside down
setUpsideDown(upsideDown)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
upsideDown | Boolean | - | - |
Returns:
Type | Description |
---|---|
RendererAPI | Returns self for chaining |
Example:
renderer:setUpsideDown(true)
isUpsideDown()
Checks if this entity should be rendered upside down
isUpsideDown()
Returns:
Type | Description |
---|---|
Boolean | - |
Example:
renderer:isUpsideDown()
shouldForcePaperdoll()
Check if the paperdoll should forcefully be rendered
shouldForcePaperdoll()
Returns:
Type | Description |
---|---|
Boolean | - |
Example:
renderer:shouldForcePaperdoll()
shouldRenderCrosshair()
Check if your crosshair should be rendered
shouldRenderCrosshair()
Returns:
Type | Description |
---|---|
Boolean | - |
Example:
renderer:shouldRenderCrosshair()
shouldRenderFire()
Checks if the fire effect should be rendered
shouldRenderFire()
Returns:
Type | Description |
---|---|
Boolean | - |
Example:
renderer:shouldRenderFire()
shouldRenderHUD()
Check if the vanilla HUD should be rendered
shouldRenderHUD()
Returns:
Type | Description |
---|---|
Boolean | - |
Example:
renderer:shouldRenderHUD()
shouldRenderVehicle()
Check if your vehicle should be rendered
shouldRenderVehicle()
Returns:
Type | Description |
---|---|
Boolean | - |
Example:
renderer:shouldRenderVehicle()
Fields
renderFire
Whether or not you should visually have the fire effect while on fire
True by default
renderVehicle
Whether or not your vehicle (boat, minecart, horse, whatever) will be rendered
True by default
renderCrosshair
Toggles whether or not your crosshair should render
True by default
forcePaperdoll
Toggles if the paperdoll should render regardless of the player doing an action
If the paperdoll is disabled, or set to always render, nothing will change
False by default
renderHUD
Toggles whether or not the vanilla HUD should be rendered
Hands and the Figura HUD are not included