Blua is a plugin which enables you to build Minecraft server plugins in Lua. You don't even have to use learn a new API, because you can interact with the Bukkit/Paper API like its Java!
For example, you could write the following example script
local bukkit = java.import "org.bukkit.Bukkit"
local component = java.import "net.kyori.adventure.text.Component"
listen("org.bukkit.event.player.PlayerJoinEvent", function(event)
bukkit:getServer():broadcast(component:text("hello world from lua!"))
end)
Please note that this is still pretty experimental, so expect rough edges.
For super basic examples on how to use the builtin functions see the examples
folder.
- place
blua.jar
inplugins
folder - put your scripts into
plugins/blua
- have fun
Currently, there is not a download link ready for the blua plugin. You have to build it yourself.
Generated auto-completions for Minecraft 1.21 can be found in the addons
folder.
codegen/
- Lua code generation for auto-completion support
javadump/
- Parse java classes and dump their properties into a json file
plugin/
- Plugin embedding luajit, so we can run lua code on the minecraft server
- When using macos install lua and luarocks using macports
sudo port install lua lua-luarocks
- Run
./prepare-work
inscripts
directory java -jar javadump.jar --config javadump.json
./codegen --in javadump.json --out lib