Allows lua scripts to be ran in Minecraft
Note: LuaDatapack is in beta, so the api is subject to change
Create a new datapack with the lua
subfolder. For example: data/foo/lua/bar.lua
require
and use Minecraft's namespaced id system/lua
Usage: /lua <name> [<args>]
Example, to run data/foo/lua/bar.lua
: /lua foo:bar
Arguments can be accessed via an array named args
The api reference can be found here. Although it is for TypeScriptToLua, it can be adapted for lua
A few utility libraries are included by default
Library | Path |
---|---|
json.lua | std:json |
class.lua | std:class |
Standard lua library | std:math |
Standard lua library | std:string |
Standard lua library | std:bit32 |
Standard lua library | std:utf8 |
Commands library | std:commands |
Note: If you prefer a different OOP library, you can simply add one to the datapack. If people do not like this one, it can be replaced in the future
Any help is appreciated. Issues and feature requests can be shared here
say
, as it is faster for some reason)Source: https://github.com/kinderhead/LuaDatapack
Modrinth: https://modrinth.com/mod/luadatapack
Api reference: https://kinderhead.github.io/LuaDatapack
Generated using TypeDoc