
Modrinth · Minecraft mod
LuaDatapack
A simple mod that allows lua to be included in datapacks
Quick answer
Which LuaDatapack release matches 1.19?
LuaDatapack 0.7.1-beta targets 1.19 with Fabric. Do not install it on the client. It must be installed on the dedicated server. All 1 required mods have matching files.
Where it goes
Is LuaDatapack required on the client, server, or both?
Do not install it on the client. It must be installed on the dedicated server.
This file is marked server-only.
What else does LuaDatapack 0.7.1-beta need?
0.7.1-beta on 1.19. Every mod below is checked against that same setup.
Install Fabric API first. We found matching files for this game-version and loader setup.
We only count dependency files that match this setup. A file for another loader does not fill the gap.
Before you install it
Add LuaDatapack without breaking your instance.
Built for LuaDatapack 0.7.1-beta on 1.19. Pick another file and the loader, install side or required mods may change.
- 01
Stick to this file
Use 0.7.1-beta. It targets 1.19 with Fabric; another release may have different loader, side or dependency requirements.
- 02
Bring the mods it needs
Install Fabric API first. We found matching files for this game-version and loader setup.
- 03
Put it on the correct side
Do not install it on the client. It must be installed on the dedicated server.
- 04
Pick the file you checked
Use the “Get this file” button beside 0.7.1-beta. It opens that exact file at the source.
About this project
What does LuaDatapack add?

LuaDatapack
Allows lua scripts to be ran in Minecraft.
Note: LuaDatapack is in beta, so the api is subject to change.
I currently don't plan on working on this project much more. Instead I've been making a dedicated programming language that compiles to Minecraft commands called Amethyst. It's more useful than this because it doesn't require a dedicated mod.
Usage
Create a new datapack with the lua subfolder. For example: data/foo/lua/bar.lua.
Features
- Uses Cobalt under the hood, which gives fast execution times
- Scripts can be included from datapacks using
requireand use Minecraft's namespaced id system - TypeScriptToLua support
- Supports a few common utility libraries
Commands
/lua
Usage: /lua <name> [<args>]
Example, to run data/foo/lua/bar.lua: /lua foo:bar
Arguments can be accessed via an array called args in the lua script.
Api
The api reference can be found here.
Standard library
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 |
| Storage library | std:storage |
| Configuration utilities library | std:config |
Note: If you prefer a different OOP library, you can simply add one to your datapack.
Project system
There is a simple project system which allows for customization of which scripts can be executed and imported by external projects (scripts not in the same namespace).
To customize your project, add a _project.lua file to your namespace. For example if the namespace was foo then you would make a foo:_project.lua:
return {
scripts = {"foo:bar"},
exports = {"foo:baz"},
depends = {"hello"},
load = {"foo:load"},
tick = {"foo:tick"}
}
In the above example foo:bar is a script to be ran via /lua, foo:baz is a script that any file can require, and it requires the hello project to function. Scripts can import any script in the same namespace, even if it is not included in the exports array. If a project does not include a _project.lua, then the default std:_default_datapack is used instead:
local config = require("std:config")
return {
scripts = config.without_underscore(),
exports = {}
}
Note: not all fields need to be explicitly defined.
If a project fails to load, all scripts in it are unable to load.
Contributing
Building this repo is the same as any other Fabric mod. There may be issues with libraries (Cobalt, Apache commons-io, etc) not loading when starting the game, but running the game though the VSCode debugger works for some reason.
Things to do
- Optimize lua api
- Add more api features
- Use commands less internally
Planned features
- More commands
- Development tools with TypeScriptToLua
Links
Source: https://github.com/kinderhead/LuaDatapack
Modrinth: https://modrinth.com/mod/luadatapack
Api reference: https://kinderhead.github.io/LuaDatapack
Project description from Modrinth.
Pick your setup
LuaDatapack by Minecraft version and loader
Choose the version and loader you play, then open the matching release.
1.20.1
1 loader build1.20
1 loader build1.19.4
1 loader build1.19
1 loader buildCheck the dependencies, then try the file in a copied instance before changing a world you care about.
Recent files
LuaDatapack versions and loaders
0.7.1-beta
luadatapack-0.7.1-beta-all.jar
28 Jul 2022
0.7.0-beta
luadatapack-0.7.0-beta-all.jar
27 Jul 2022
0.6.0-beta
luadatapack-0.6.0-beta-all.jar
19 Jul 2022
0.5.0-beta
luadatapack-0.5.0-beta-all.jar
14 Jul 2022
0.4.1-beta
luadatapack-0.4.1-beta-all.jar
13 Jul 2022
0.4.0-beta
luadatapack-0.4.0-beta-all.jar
13 Jul 2022
0.3.1-alpha
luadatapack-0.3.1-alpha-all.jar
13 Jul 2022
0.3.0-alpha
luadatapack-0.3.0-alpha-all.jar
13 Jul 2022
0.2.0-alpha
luadatapack-0.2.0-alpha-all.jar
9 Jul 2022
v0.1.0-alpha
luadatapack-0.1.0-alpha-all.jar
9 Jul 2022
Looking for an older file? The official Modrinth project page is in Resources.