
Что это
A simple mod that allows lua to be included in datapacks
- Тип: мод
- Загрузчик: fabric
- Версии Minecraft: 1.19 – 1.20.1
- Скачиваний на Modrinth: 1 585
Подробно
[](https://github.com/kinderhead/LuaDatapack/releases) [](https://modrinth.com/mod/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.
Create a new datapack with the lua subfolder. For example: data/foo/lua/bar.lua.
Uses Cobalt under the hood, which gives fast execution times Scripts can be included from datapacks using require and use Minecraft's namespaced id system TypeScriptToLua support Supports a few common utility libraries json.lua class.lua
Example, to run data/foo/lua/bar.lua: /lua foo:bar
Arguments can be accessed via an array called args in the lua script.
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.
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:
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:defaultdatapack is used instead: lua local config = require("std:config")
return { scripts = config.withoutunderscore(), exports = {} }
Note: not all fields need to be explicitly defined.
If a project fails to load, all scripts in it are unable to load.
Building this repo is the same as any oth
Как установить
Скачайте файл на официальной странице ниже и положите его в папку mods (для модов) или plugins (для плагинов) вашего сервера или клиента. Для модов нужен совместимый загрузчик. Версия должна совпадать с версией Minecraft.
Текст подготовлен автоматически из описания на Modrinth и ждёт проверки редакцией.
Комментарии 0
Комментарии к этому материалу отключены.
Читайте также
Dangerous Elytras
Server-side mod that adds friction damage when landing with the elytra and makes other tweaks to make elytra flight more dangerous 06.12.2026
Blade of a Thousand Winds
a pretty cool sword ngl thats slices and dices 06.12.2026
asdf TacoMaster's World
A mod which adds some funny mobs to the game, such as screaming possums and Skibidi Toilets! 06.12.2026
cosmer wax and Wayne
Most of the tech and magic in Alloy of Law 06.12.2026
Statichitboxes
This is a Hitboxes Mod which helps you in pvp gamemodes like -> nethpot 06.12.2026
Toaster's Stack Size Mod
Increased stack sizes for certain items, with code tweaks for even greater stacks. 06.12.2026