-- 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)