# LuaLink v2

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.


High Performance
LuaLink leverages LuaJava and LuaJIT, which are implemented primarily in C, ensuring fast and efficient execution.
User-Friendly API
Simplifies scripting with an intuitive and easy-to-use API.
Simple Command Registration
Register commands effortlessly with a single function.
Event Listening
Listen to Bukkit, Spigot, Paper, or even custom plugin events.
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.
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.
Access Everything
Full access to Bukkit API, built-in libraries and loaded plugins.

# Installation

Before you begin, make sure you have met the following requirements:

  • Paper based server running 1.20 or higher, and Java 21.
  • Basic understanding of Lua scripting and general programming concepts is beneficial.

Plugin can be downloaded from following sources:


# Quick Start

After you have installed the plugin, you can start writing your first script.

  • Script life-cycle can be managed using /lualink load, /lualink unload and /lualink reload commands.
  • Each script is stored in a separate folder inside the plugins/LuaLink/scripts directory.
  • Entry point of the script is a file named main.lua.
plugins/LuaLink/scripts/my_script/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.

plugins/LuaLink/scripts/my_script/main.lua
-- 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.