Paprika icon

Paprika -----

Code your plugins in Lua



Paprika
Paprika is a plugin with an included Lua 5.2 interpreter and bindings, allowing you to write plugins in Lua. This plugin is great for anyone who wants to use an easier to learn programming language to make plugins and anyone who happens to dislike Java.

This has been done twice before, each on older versions. Paprika is unique because we use reflection and built in LuaJ functions to automatically create bindings. In theory (though this has not been tested) this should work on future Minecraft versions, and should work on any Spigot-compatible server that has the "getHandlerLists" function (which appears to date back to 2013). In practice, this is untested.

Usage
- All event handlers have a corresponding Lua function that shares the name, minus the word "Event" and with "On" added (e.g. PlayerBedEnterEvent -> OnPlayerBedEnter) and all of these functions can take a Lua usertable converted from the relevant event. Multiple functions can be defined with the same event handler name and they'll all be executed when the event handler files.
- Functions that start with "MinecraftCommand..." get bound to actual commands, and they get fed with the arguments the command handler gets: the command sender, command name, and a table of the arguments. In the example below, the function MinecraftCommandTest will get bound to /test.
- Getter functions are mapped to field accesses and setter functions are mapped to field sets. "event.player" is the same as "event:getPlayer()" and "event.cancelled = true" is the same as "event:setCancelled(true)"


upload_2023-1-6_14-34-8.png
A proper documentation, with all of the Spigot functions listed, is planned.

--------------------------------------------------------------------------------------------------


Skript is also an option, but it's a plugin that only has Minecraft-specific functions, some math functions, and a whole lot of specific, high level functions like "get bitcoin" and "display 2fa". Lua is a more traditional programming language that comes with mostly logistical functions, and it's backed by almost 20 years of libraries.
(it also has "letters only syntax" a concept which I personally believe results in extremely subjective decisions and often just leads to more frustrating syntax in every language I've used it in);
Resource Information
Author:
----------
Total Downloads: 283
First Release: Jan 3, 2023
Last Update: Jan 11, 2023
Category: ---------------
All-Time Rating:
1 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings