Download the entire FOXAPI folder containing api.lua
and the modules folder. Move the FOXAPI folder to your avatar's directory.
Downloaded modules go into the modules folder FOXAPI\modules
. Only modules written for FOXAPI should be put in this folder. Subfolders are supported.
All modules and libraries are returned from a single require to FOXAPI\api.lua
. Here's an example of how you can require a module.
local line = require("FOXAPI.api").line
-- Using the line module to create a line
line.new():setPos(-client.getScaledWindowSize() / 2, vec(0, 0, 0))
local foxpat = require("FOXAPI.api").foxpat
-- Editing a FOXPat config
foxpat.config.patParticle = "minecraft:heart"
Some functions of this API are also global (With the use of a require)
require("FOXAPI.api")
-- FOXPat event
function events.entity_pat(entity, state)
print("Patted by " .. entity)
end
-- FOXAPI functon
print(vectors.random())