Lukkit
Search…
Plugin
Represented by plugin.
  • plugin.onLoad(callback: function)
    Event called when the plugin has been loaded.
    1
    plugin.onLoad(function()
    2
    logger.info("Plugin loaded")
    3
    end)
    Copied!
  • plugin.onEnable(callback: function)
    Event called when the plugin has been enabled.
    1
    plugin.onEnable(function()
    2
    logger.info("Plugin enabled")
    3
    end)
    Copied!
  • plugin.onDisable(callback: function)
    Event called when the plugin has been disabled.
    1
    plugin.onDisable(function()
    2
    logger.info("Plugin disabled")
    3
    end)
    Copied!
  • plugin.addCommand(options: table, callback: function) : Command
    Create a command. More information on creating commands can be found here.
    1
    local testCommand = plugin.addCommand({name="hello",description="Hello world"}, function(cmd)
    2
    plugin.getServer():broadcastMessage("Hello, world!")
    3
    end)
    Copied!
  • plugin.registerEvent(event: string, callback: function)
    Register an event. More information on registering events can be found here.
    1
    plugin.registerEvent("BlockBreakEvent", function(e)
    2
    e:getPlayer():sendMessage("You broke a break")
    3
    end)
    Copied!
  • plugin.getServer() : org.bukkit.Server
    Returns the server object. This is equivalent to Bukkit.getServer() in Java.
    1
    local server = plugin.getServer()
    Copied!
  • plugin.isNaggable() : boolean
    Returns true if the plugin can nag to the log or false otherwise.
    1
    if plugin.isNaggable() then
    2
    logger.info("Plugin is naggable")
    3
    end
    Copied!
  • plugin.setNaggable(nag: boolean)
    Set the nagging state.
    1
    plugin.setNaggable(true)
    Copied!
  • plugin.exportResource(path: string, replace: boolean):
    Export a resource from inside of the plugin workspace to the plugin's data folder.
  • plugin.getStorageObject(file: string) : StorageObject
    Read a YAML or JSON storage file. More information and examples on storage files can be found here.
Last modified 2yr ago
Copy link