Plugin
Represented by plugin.
plugin.onLoad(callback: function)Event called when the plugin has been loaded.
plugin.onLoad(function() logger.info("Plugin loaded") end)plugin.onEnable(callback: function)Event called when the plugin has been enabled.
plugin.onEnable(function() logger.info("Plugin enabled") end)plugin.onDisable(callback: function)Event called when the plugin has been disabled.
plugin.onDisable(function() logger.info("Plugin disabled") end)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") end)plugin.getServer(): org.bukkit.ServerReturns the server object. This is equivalent to
Bukkit.getServer()in Java.local server = plugin.getServer()plugin.isNaggable(): booleanReturns true if the plugin can nag to the log or false otherwise.
if plugin.isNaggable() then logger.info("Plugin is naggable") endplugin.setNaggable(nag: boolean)Set the nagging state.
plugin.setNaggable(true)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): StorageObjectRead a YAML or JSON storage file. More information and examples on storage files can be found here.
Last updated