Skip to main content

Renderer

A global API providing functions that change the way Minecraft renders your player

warning

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:

NameTypeDescriptionDefault
matrixMatrix4--

Returns:

TypeDescription
RendererAPIReturns 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:

TypeDescription
Matrix4-

Example:

renderer:getCameraMatrix()

setCameraNormal()

Aliases: cameraNormal()

Sets the camera normal matrix with the given matrix

setCameraNormal(matrix)

Parameters:

NameTypeDescriptionDefault
matrixMatrix3--

Returns:

TypeDescription
RendererAPIReturns 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:

TypeDescription
Matrix3-

Example:

renderer:getCameraNormal()

getCameraOffsetPivot()

Gets the offset pivot for the camera

getCameraOffsetPivot()

Returns:

TypeDescription
Vector3-

Example:

renderer:getCameraOffsetPivot()

getCameraOffsetRot()

Gets the offset rotation for the camera

getCameraOffsetRot()

Returns:

TypeDescription
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

setCameraPivot(pivot)

Parameters:

NameTypeDescriptionDefault
pivotVector3--

Returns:

TypeDescription
RendererAPIReturns 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:

TypeDescription
Vector3-

Example:

renderer:getCameraPivot()

setCameraPos()

Aliases: cameraPos()

Sets the position offset for the camera

Nil values for position are assumed to be 0

setCameraPos(pos)

Parameters:

NameTypeDescriptionDefault
posVector3--

Returns:

TypeDescription
RendererAPIReturns self for chaining

Example:

renderer:setCameraPos(0, 2, 0)

getCameraPos()

Gets the position offset for the camera

getCameraPos()

Returns:

TypeDescription
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

setCameraRot(rot)

Parameters:

NameTypeDescriptionDefault
rotVector3--

Returns:

TypeDescription
RendererAPIReturns self for chaining

Example:

renderer:setCameraRot(0, 90, 0)

getCameraRot()

Gets the absolute rotation of the camera

getCameraRot()

Returns:

TypeDescription
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

setOffsetCameraPivot(pivot)

Parameters:

NameTypeDescriptionDefault
pivotVector3--

Returns:

TypeDescription
RendererAPIReturns 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

setOffsetCameraRot(rot)

Parameters:

NameTypeDescriptionDefault
rotVector3--

Returns:

TypeDescription
RendererAPIReturns 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:

TypeDescription
Boolean-

Example:

renderer:isFirstPerson()

isCameraBackwards()

Checks if your camera is in the backward third person view

isCameraBackwards()

Returns:

TypeDescription
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

setBlockOutlineColor(rgb)

Parameters:

NameTypeDescriptionDefault
rgbVector3--

Returns:

TypeDescription
RendererAPIReturns 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:

TypeDescription
Vector4-

Example:

renderer:getBlockOutlineColor()

setCrosshairOffset()

Aliases: crosshairOffset()

Sets the offset of your crosshair

setCrosshairOffset(vec)

Parameters:

NameTypeDescriptionDefault
vecVector2--

Returns:

TypeDescription
RendererAPIReturns self for chaining

Example:

renderer:setCrosshairOffset(20, 20)

getCrosshairOffset()

Gets the offset of your crosshair

getCrosshairOffset()

Returns:

TypeDescription
Vector2-

Example:

renderer:getCrosshairOffset()

setEyeOffset()

Aliases: eyeOffset()

caution

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

setEyeOffset(pos)

Parameters:

NameTypeDescriptionDefault
posVector3--

Returns:

TypeDescription
RendererAPIReturns self for chaining

Example:

renderer:setEyeOffset(0, 2, 0)

getEyeOffset()

Returns the offset for the entity eye position

Default nil

getEyeOffset()

Returns:

TypeDescription
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

setFOV()

Returns:

TypeDescription
RendererAPIReturns self for chaining

Example:

renderer:setFOV(2)

getFOV()

Gets the multiplier of your fov

getFOV()

Returns:

TypeDescription
Number-

Example:

renderer:getFOV()

setForcePaperdoll()

Sets if the paperdoll should forcefully be rendered

setForcePaperdoll(forcePaperdoll)

Parameters:

NameTypeDescriptionDefault
forcePaperdollBoolean--

Returns:

TypeDescription
RendererAPIReturns self for chaining

Example:

renderer:setForcePaperdoll(true)

setOutlineColor()

Aliases: outlineColor()

Sets the custom glowing effect's outline color

setOutlineColor(rgb)

Parameters:

NameTypeDescriptionDefault
rgbVector3--

Returns:

TypeDescription
RendererAPIReturns self for chaining

Example:

renderer:setOutlineColor(0, 0, 1)

getOutlineColor()

Gets the custom glowing effect's outline color

getOutlineColor()

Returns:

TypeDescription
Vector3-

Example:

renderer:getOutlineColor()

setPostEffect()

Aliases: postEffect()

Sets the current rendering effect

Same as the discontinued Super Secret Settings

setPostEffect(effect)

Parameters:

NameTypeDescriptionDefault
effectString--

Returns:

TypeDescription
RendererAPIReturns 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:

NameTypeDescriptionDefault
idString--

Returns:

TypeDescription
RendererAPIReturns self for chaining

Example:

renderer:setPrimaryFireTexture("textures/block/soul_fire_0")

getPrimaryFireTexture()

Gets the current custom primary fire texture

getPrimaryFireTexture()

Returns:

TypeDescription
String-

Example:

renderer:getPrimaryFireTexture()

setRenderCrosshair()

Sets if your crosshair should be rendered

setRenderCrosshair(renderCrosshair)

Parameters:

NameTypeDescriptionDefault
renderCrosshairBoolean--

Returns:

TypeDescription
RendererAPIReturns self for chaining

Example:

renderer:setRenderCrosshair(false)

setRenderFire()

Sets if the fire effect should be rendered

setRenderFire(renderFire)

Parameters:

NameTypeDescriptionDefault
renderFireBoolean--

Returns:

TypeDescription
RendererAPIReturns self for chaining

Example:

renderer:setRenderFire(false)

setRenderHUD()

Sets if the vanilla HUD should be rendered

setRenderHUD(renderHUD)

Parameters:

NameTypeDescriptionDefault
renderHUDBoolean--

Returns:

TypeDescription
RendererAPIReturns 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:

NameTypeDescriptionDefault
boolBoolean--

Returns:

TypeDescription
RendererAPIReturns self for chaining

Example:

renderer:setRenderLeftArm(true)

getRenderLeftArm()

Gets if the left arm should be rendered while in first person

getRenderLeftArm()

Returns:

TypeDescription
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:

NameTypeDescriptionDefault
boolBoolean--

Returns:

TypeDescription
RendererAPIReturns self for chaining

Example:

renderer:setRenderRightArm(true)

getRenderRightArm()

Gets if the right arm should be rendered while in first person

getRenderRightArm()

Returns:

TypeDescription
Boolean-

Example:

renderer:getRenderRightArm()

setRenderVehicle()

Sets if your vehicle should be rendered

setRenderVehicle(renderVehicle)

Parameters:

NameTypeDescriptionDefault
renderVehicleBoolean--

Returns:

TypeDescription
RendererAPIReturns 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:

NameTypeDescriptionDefault
boolBoolean--

Returns:

TypeDescription
RendererAPIReturns self for chaining

Example:

renderer:setRootRotationAllowed(true)

getRootRotationAllowed()

Gets if the model should have root rotations applied

getRootRotationAllowed()

Returns:

TypeDescription
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:

NameTypeDescriptionDefault
idString--

Returns:

TypeDescription
RendererAPIReturns self for chaining

Example:

renderer:setSecondaryFireTexture("textures/block/soul_fire_1")

getSecondaryFireTexture()

Gets the current custom secondary fire texture

getSecondaryFireTexture()

Returns:

TypeDescription
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

setShadowRadius()

Returns:

TypeDescription
RendererAPIReturns self for chaining

Example:

renderer:setShadowRadius(12)

getShadowRadius()

Gets the radius of your shadow

getShadowRadius()

Returns:

TypeDescription
Number-

Example:

renderer:getShadowRadius()

setUpsideDown()

Aliases: upsideDown()

Sets if this entity will be rendered upside down

setUpsideDown(upsideDown)

Parameters:

NameTypeDescriptionDefault
upsideDownBoolean--

Returns:

TypeDescription
RendererAPIReturns self for chaining

Example:

renderer:setUpsideDown(true)

isUpsideDown()

Checks if this entity should be rendered upside down

isUpsideDown()

Returns:

TypeDescription
Boolean-

Example:

renderer:isUpsideDown()

shouldForcePaperdoll()

Check if the paperdoll should forcefully be rendered

shouldForcePaperdoll()

Returns:

TypeDescription
Boolean-

Example:

renderer:shouldForcePaperdoll()

shouldRenderCrosshair()

Check if your crosshair should be rendered

shouldRenderCrosshair()

Returns:

TypeDescription
Boolean-

Example:

renderer:shouldRenderCrosshair()

shouldRenderFire()

Checks if the fire effect should be rendered

shouldRenderFire()

Returns:

TypeDescription
Boolean-

Example:

renderer:shouldRenderFire()

shouldRenderHUD()

Check if the vanilla HUD should be rendered

shouldRenderHUD()

Returns:

TypeDescription
Boolean-

Example:

renderer:shouldRenderHUD()

shouldRenderVehicle()

Check if your vehicle should be rendered

shouldRenderVehicle()

Returns:

TypeDescription
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