Skip to content

A Lua scripting engine for Spigot allowing to customise Minecraft gameplay without diving into Java code.

License

Notifications You must be signed in to change notification settings

EngiN33R/LuaSpigot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LuaSpigot

A Lua scripting engine for Spigot making it possible to customise Minecraft gameplay without diving into Java code.

Installation and usage

LuaSpigot is fully Maven-integrated. If Maven installation is impossible, correct functioning of the plugin depends on having LuaJ in the classpath.

LuaSpigot is used like any other Spigot plugin - simply drop it into the plugins directory and let it work its magic from there.

To use LuaSpigot in your own plugin, you will first need to initialise it (in onEnable or similar):

LuaSpigot luaSpigot = new LuaSpigot(this);

After initialisation, enable any libraries you wish to expose to scripts:

luaSpigot.getLibraryRegistry().register(new ChatLibrary());
luaSpigot.getLibraryRegistry().register(new PlayerLibrary());

Once LuaSpigot is set up, you can create a state for scripts to use:

State state = luaSpigot.newState();

The state object can then be used to execute Lua code from a string or a file:

state.execute("print('Hello world!')");
state.load("scripts/test.lua"); // Relative to server JAR

About

A Lua scripting engine for Spigot allowing to customise Minecraft gameplay without diving into Java code.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages