| label | Home |
|---|---|
| icon | home |
| order | 100 |
LuaLink is an experimental plugin that provides a basic Lua scripting runtime for Paper-based Minecraft servers. It is designed for small and simple tasks and serves as a much more powerful alternative to Skript and other scripting plugins.
Scripting runtime is based on LuaJava with LuaJIT. For more details on implementation specifics or differences, please refer to their respective documentation.
<style> .features { .table-wrapper, td, th { border-color: transparent !important; } .docs-icon { font-size: 1.25em; } } </style>
:::features {.compact}
| :icon-rocket: | High Performance LuaLink leverages LuaJava and LuaJIT, which are implemented primarily in C, ensuring fast and efficient execution. |
| :icon-thumbsup: | User-Friendly API Simplifies scripting with an intuitive and easy-to-use API. |
| :icon-terminal: | Simple Command Registration Register commands effortlessly with a single function. |
| :icon-zap: | Event Listening Listen to Bukkit, Spigot, Paper, or even custom plugin events. |
| :icon-file: | Script Organization Split scripts into multiple files. Each script requires a main.lua entry point but can load additional files using Lua’s require function. |
| :icon-package-dependencies: | Java Library Integration Extend LuaLink’s capabilities by using any Java library. Whether it’s for a Discord bot, HTTP server, or anything else you can imagine. |
| :icon-globe: | Access Everything Full access to Bukkit API, built-in libraries and loaded plugins. |
| ::: |
Before you begin, make sure you have met the following requirements:
- Paper based server running 1.20 or higher, and Java 21.
- System or container environment with glibc 2.34 or higher.
For example Debian 12, Ubuntu 22.04, CentOS 9 and newer. - Basic understanding of Lua scripting and general programming concepts is beneficial.
Plugin can be downloaded from following sources:
{.list-icon}
After you have installed the plugin, you can start writing your first script.
- Script life-cycle can be managed using
/lualink load,/lualink unloadand/lualink reloadcommands. - Each script is stored in a separate folder inside the
plugins/LuaLink/scriptsdirectory. - Entry point of the script is a file named
main.lua.
-- Called after the script has been successfully loaded.
script:onLoad(function()
-- Logging message to the console.
print("Hello, World!")
end)
It's quite simple, isn't it? For this particular case, we can simplify it even further by extracting the logic away from the onLoad block.
-- Logging message to the console.
print("Hello, World!")Want to do something more complex? More information on how to write scripts can be found on the Getting Started page.