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 Jun 19, 2014luajava.findClass("some.plugin.class.path") Does not seem to work, only with bukkit classes
I'm guessing it is due to bukkits seperation of plugins with their own classloader.
So how would you go about fixing this issue?
-
View User Profile
-
Send Message
Posted Jun 15, 2014@UnwrittenFun
Thanks!
-
View User Profile
-
Send Message
Posted Jun 8, 2014@z0fa
Interesting quirk there with bukkit expecting an array of ItemStacks for addItem, although in Java you could just supply one, in lua you must force an array
simply change this
to
note the {} around thorHammer
-
View User Profile
-
Send Message
Posted Jun 8, 2014@Citnam
Find it here (github)
-
View User Profile
-
Send Message
Posted May 28, 2014So.... What's the ETA on 1.7.9? :3
What does it take to come up to speed with the latest version? Need any help?
-
View User Profile
-
Send Message
Posted May 22, 2014I get "coercion error java.lang.IllegalArgumentException: argument type mismatch" with this code :S
-
View User Profile
-
Send Message
Posted Apr 11, 2014@UnwrittenFun
Could you add support for the creation and detection of folders too?
Edit: and the option to write to a new line, instead of replacing the entire file?
-
View User Profile
-
Send Message
Posted Apr 10, 2014@UnwrittenFun
Ahhh, great thank you! You did right here btw.
-
View User Profile
-
Send Message
Posted Apr 10, 2014@Nabakin
It's plugin.readFile (I may have said it was plugin.read somewhere by accident)
-
View User Profile
-
Send Message
Posted Apr 10, 2014could someone please give me an example of how to use the plugin.read function?
-
View User Profile
-
Send Message
Posted Apr 9, 2014@UnwrittenFun
YES, THANK YOU!
-
View User Profile
-
Send Message
Posted Apr 8, 2014@UnwrittenFun
What would the whole code look like if i wanted it at a specific location?
-
View User Profile
-
Send Message
Posted Apr 8, 2014@DaGamerMinecraft
Assuming you have already got the block just do
You can replace STONE with anything here
-
View User Profile
-
Send Message
Posted Apr 7, 2014Love that this plugin is back up and managed.
Requesting some type of network socket or database socket system, please! This is too good to be isolated to itself.
JSON system would be awesome too. Yes I know there are pure lua solutions for json.
Build it, and plenty will come... =)
-
View User Profile
-
Send Message
Posted Apr 7, 2014@UnwrittenFun How do I set blocks in a plugin.
-
View User Profile
-
Send Message
Posted Apr 7, 2014NVM I got it to work
-
View User Profile
-
Send Message
Posted Apr 7, 2014@UnwrittenFun What Would The Whole Text Look Like Because I Am Not The Best At Programming.
-
View User Profile
-
Send Message
Posted Apr 7, 2014Lukkit v1.0-alpha5 is out
You can grab it from github until Bukkit approves the file.
New in alpha5:
-
View User Profile
-
Send Message
Posted Apr 7, 2014@DaGamerMinecraft
Assuming you have determined the block is actually a sign, the following should work (haven't tested):
Then you would just check if the text is equal to the text you want
-
View User Profile
-
Send Message
Posted Apr 7, 2014@glessimus
I've yet to add a method plugins that allow you to get the directory for your plugin. Have had some plans to easily make config files, and I guess I could extend that to any file.