Lukkit - Lua for Bukkit
Lukkit v1.0-alpha5
It's back! The plugin that allows you to write other plugins in Lua is now at version 1.0 with a complete re-write. With the new version you have access to ALL Bukkit functions and events.
Documentation
For documentation, go to the Bukkit docs and the Lukkit wiki.
Download
Go to the Files tab to download the alpha release
Help
If you need some help with Lukkit you can post in the forums. Make sure to take a look at the examples and documenation.
Examples
More examples are available on github
-- Add command /shout to broadcast a message to the server -- Command name, short description, command usage lukkit.addCommand("shout", "Broadcast a message to the server", "/shout Your message here", function(sender, args) broadcast(table.concat(args, " ")) end)
-- Only allow ops to break blocks events.add("blockBreak", function(event) if not event:getPlayer():isOp() then broadcast(stringOf(format.RED) .. "You are not allowed to break blocks") event:setCancelled(true) end end)
-- lukkit.addPlugin(pluginName, pluginVersion, pluginContent) local helloPlugin = lukkit.addPlugin("HelloPlugin", "1.0", function(plugin) plugin.onEnable(function() plugin.print("HelloPlugin v" .. plugin.version .. " enabled") end) plugin.onDisable(function() plugin.warn("HelloPlugin v" .. plugin.version .. " disabled") end) -- At the moment naming a command with a capital letter will stop the command from being deregistered when running /lukkit reload or /lukkit resetenv plugin.addCommand("hello", "Send the sender the message 'Hello, world!'", "/hello", function(sender, args) sender:sendMessage("Hello, world!") end) -- Set the value if not already in the config -- plugin.config.setDefault(path, value) plugin.config.setDefault("test.bool", false) plugin.config.setDefault("test.int", 45) -- Set the value regardless of if it already exists -- plugin.config.set(path, value) plugin.config.set("test.float", 4.7) plugin.config.set("test.string", "a string") -- plugin.config.get(path, default) plugin.config.get("test.bool", true) -- Remove the config option plugin.clear("test.float") -- Save the config to file plugin.config.save() end)
Videos
Overview with examples from VX | cheese
-
View User Profile
-
Send Message
Posted Apr 6, 2014@glessimus
hey I figured out how to get the xyz values, but your function still doesn't work for me. I have to do this:
and your function returns errors for me when I use it, because Lukkit still can't find getX(), getY(), and getZ(). But I was able to make this function from it:
-
View User Profile
-
Send Message
Posted Apr 6, 2014@Nabakin
I use this func
-
View User Profile
-
Send Message
Posted Apr 6, 2014When I use
it seems to return only the X coordinate. When I try to use
as referenced here it doesn't seem to work. Please help, thanks
-
View User Profile
-
Send Message
Posted Apr 6, 2014@glessimus
Thanks!!! It works!
-
View User Profile
-
Send Message
Posted Apr 6, 2014@lolko555
Try
-
View User Profile
-
Send Message
Posted Apr 6, 2014Can I implement this in Lua?
When i try:
I'm getting an error:
-
View User Profile
-
Send Message
Posted Apr 5, 2014@UnwrittenFun can it see if a player clicked a sign with specific text?
-
View User Profile
-
Send Message
Posted Apr 5, 2014UnwrittenFun,
Are you going to make file system? I want to store players data.
But this files are saved in root directory. (Where server. jar is located) I have to write full path to files. (Something like /plugins/Lukkit/<Plugin>/Players/<UUID>.dat) That looks dump. P.S. New plugin system is freaking awesome.
-
View User Profile
-
Send Message
Posted Mar 30, 2014@nedurland
Yeah, I was planning to add something like that, just trying to figure out the best way to do it.
-
View User Profile
-
Send Message
Posted Mar 30, 2014is it possible to make a folder for a lua plugin so you can make a storage and options yml? and to have permissions for commands? And how could you do that if a player clicks on a sign he joins a game
-
View User Profile
-
Send Message
Posted Mar 30, 2014@nedurland
Fixed and cleaned up removeItem func. Now it works.
Done. Snowballs are used as ammo. http://pastebin.com/hnZQcQ8h
-
View User Profile
-
Send Message
Posted Mar 29, 2014@glessimus
The following works for me, although it does remove the amount from each stack found
I will add tableFromArray to the next version of Lukkit, in the mean time, this is the code for it:
-
View User Profile
-
Send Message
Posted Mar 29, 2014Trying to make item remove func. What am i doing wrong? And why does Inventory:getContents() return userdata instead of table. Tried to use "tableFromList". But it doesn't work. :(
Thanks for help.
-
View User Profile
-
Send Message
Posted Mar 29, 2014@glessimus
-
View User Profile
-
Send Message
Posted Mar 29, 2014Need some help!! How can i implement this in Lua?
-
View User Profile
-
Send Message
Posted Mar 29, 2014@glessimus
could you make that you need snowballs as ammo?
-
View User Profile
-
Send Message
Posted Mar 29, 2014is it possible to make a folder for a lua plugin so you can make a storage and options yml? and to have permissions for commands? And how could you do that if a player clicks on a sign he joins a game
-
View User Profile
-
Send Message
Posted Mar 28, 2014Computercraft for Bukkit, Anyone?
-
View User Profile
-
Send Message
Posted Mar 28, 2014@nullschritt
I just added a way to run code asynchronously to alpha3, you can do it like so
The above will broadcast "Point 1", then "Point 3", then 5 seconds later "Point 2"
You can grab it on github until Bukkit approves the download
-
View User Profile
-
Send Message
Posted Mar 28, 2014@glessimus
Sweet, keep me posted