Represented by plugin.

  • plugin.onLoad(callback: function)

    Event called when the plugin has been loaded.

    plugin.onLoad(function()"Plugin loaded")
  • plugin.onEnable(callback: function)

    Event called when the plugin has been enabled.

    plugin.onEnable(function()"Plugin enabled")
  • plugin.onDisable(callback: function)

    Event called when the plugin has been disabled.

    plugin.onDisable(function()"Plugin disabled")
  • plugin.addCommand(options: table, callback: function) : Command

    Create a command. More information on creating commands can be found here.

    local testCommand = plugin.addCommand({name="hello",description="Hello world"}, function(cmd)
      plugin.getServer():broadcastMessage("Hello, world!")
  • plugin.registerEvent(event: string, callback: function)

    Register an event. More information on registering events can be found here.

    plugin.registerEvent("BlockBreakEvent", function(e)
      e:getPlayer():sendMessage("You broke a break")
  • plugin.getServer() : org.bukkit.Server

    Returns the server object. This is equivalent to Bukkit.getServer() in Java.

    local server = plugin.getServer()
  • plugin.isNaggable() : boolean

    Returns true if the plugin can nag to the log or false otherwise.

    if plugin.isNaggable() then"Plugin is naggable")
  • plugin.setNaggable(nag: boolean)

    Set the nagging state.

  • 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 updated