Flarial
Guide 08

Scripting API

Build Lua modules, commands, settings, and event-driven client extensions.

Overview

Flarial Scripting lets you extend the client with Lua scripts that behave like lightweight modules or commands. It is built for fast iteration: write a script, reload it in-game, then tune settings and event handlers without rebuilding the client.

The scripting runtime is based on Lua 5.4.7. Use this article as the website-level map, then use the dedicated scripting docs for exact API calls, signatures, and examples.

Open Scripting Docs
RuntimeLua 5.4.7
Script typesModules and commands
Reload loop.lua reload
Editor helper.lua autocomplete

What scripts can do

Create modules

Scripts can define custom ClickGUI-visible modules with names, descriptions, toggles, and settings.

Add commands

Command scripts live beside module scripts and are useful for small tools, chat helpers, or workflow shortcuts.

Listen to events

Use event hooks to react to game, chat, player, GUI, network, and client-side changes exposed by the API.

Use reviewed scripts

Community scripts can be distributed through the Flarial Marketplace after review by the Flarial team.

Project layout

Flarial keeps scripts under Minecraft's local app data so they travel with the client state. Keep the whole Scripts folder open in your editor when using autocomplete.

Modules
Commands
Autocomplete

First module pattern

A module script starts with global metadata, declares settings in the global scope, then reacts to lifecycle functions or events. Save the file as .lua inside the Modules folder.

name = "Auto GG Lite"
description = "Sends a quick GG when a win message appears."

enabled = settings.addToggle("Enabled", "Allow the script to send GG.", true)

onEvent("ChatReceiveEvent", function(message, playerName, type)
    if not enabled.value then return end

    if message == "won the game" then
        player.say("gg")
    end
end)

Workflow

  1. 1Install Visual Studio Code and a Lua extension, then open the full Scripts folder.
  2. 2Inject Flarial, run .lua autocomplete in chat, and add the AutoComplete folder to the Lua extension third-party library setting.
  3. 3Create a Lua file in Modules or Commands with a name and description.
  4. 4Run .lua reload in chat after edits, then enable the module from ClickGUI or run the command in-game.
  5. 5Move from the quick pattern here to the API docs when you need client, game, GUI, ImGui, filesystem, or utility APIs.

Full API reference

The full documentation covers the script object, client APIs, audio, network, events, player, server, GUI constraints, settings, ImGui draw lists, filesystem helpers, globals, objects, and utilities.